Sun Java System Application Server 9.1 Update 1-9.1 Update 2 Release Notes

ASQuickStartup breaks SocketChannel.keyFor(), returning null instead of the SelectionKey (Issue Tracker 3027)

Description

When a SocketChannel is registered on several Selectors, doing socketChannel.keyFor(lastRegisteredSelector) returns null instead of the SelectionKey.

Solution

This is related to a JDK bug, 6562829, and is expected to be fixed in 6.0 U3. A workaround has been included in Application Server 9.1, such that the selector is unwrapped before the keyFor API is called. This enables the keyFor to succeed until JDK bug is fixed.