IllegalStateException during unwrap.

Virat Gohil virat.gohil at gmail.com
Wed Apr 29 07:13:06 EDT 2009


Hi All,

<>Please ignore the first message, it is incomplete<>

I am getting the following exception in my server logs after about 2-3
minutes of uptime. Please help me in indentifying the solution for
this issue:

///////Start of logging
29 Apr 2009 16:17:30:021 ERROR [pool-3-thread-18]  root -
java.lang.IllegalStateException: Internal error
29 Apr 2009 16:17:30:022 ERROR [pool-3-thread-18]  root -       at
com.sun.net.ssl.internal.ssl.SSLEngineImpl.initHandshaker(Unknown
Source)
29 Apr 2009 16:17:30:022 ERROR [pool-3-thread-18]  root -       at
com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(Unknown Source)
29 Apr 2009 16:17:30:022 ERROR [pool-3-thread-18]  root -       at
com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(Unknown
Source)
29 Apr 2009 16:17:30:022 ERROR [pool-3-thread-18]  root -       at
com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(Unknown Source)
29 Apr 2009 16:17:30:023 ERROR [pool-3-thread-18]  root -       at
javax.net.ssl.SSLEngine.unwrap(Unknown Source)
29 Apr 2009 16:17:30:023 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:699)
29 Apr 2009 16:17:30:023 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.handler.ssl.SslHandler.decode(SslHandler.java:445)
29 Apr 2009 16:17:30:024 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:270)
29 Apr 2009 16:17:30:024 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:210)
29 Apr 2009 16:17:30:024 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:87)
29 Apr 2009 16:17:30:025 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.handler.codec.frame.FrameDecoder.handleUpstream(FrameDecoder.java:170)
29 Apr 2009 16:17:30:025 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:342)
29 Apr 2009 16:17:30:025 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:329)
29 Apr 2009 16:17:30:025 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:299)
29 Apr 2009 16:17:30:026 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:254)
29 Apr 2009 16:17:30:026 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:176)
29 Apr 2009 16:17:30:026 ERROR [pool-3-thread-18]  root -       at
org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:49)
29 Apr 2009 16:17:30:027 ERROR [pool-3-thread-18]  root -       at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
29 Apr 2009 16:17:30:027 ERROR [pool-3-thread-18]  root -       at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
29 Apr 2009 16:17:30:027 ERROR [pool-3-thread-18]  root -       at
java.lang.Thread.run(Unknown Source)
/////////end of logging

I am not sure, but It looks like messageReceived is fired before
SSLHandshake is finished.

Some more information:
1. I am doing some DB operation in my channelConnected method (p.s.
the operation are done within the FutureListener).
2. I am using Netty 3.1 Beta 2.
3. JDK 1.5.0_11, Solaris 10 on a SPARC system.

My handler.channelConnected() looks something like below:

public void channelConnected(...)
{
 // get SSLHandshake furure = handshakeFuture
 handshakeFuture.addListener(new ChannelFutureListener(){
 public void operationComplete(...){
   if(isNodePresentInDB())
      //accept the connection and add the channel to channel group
   else if(isConnectionFromLocalInterface())
    // accept the connection and add channel to channel group
   else
      //connection is from a invalid node, ignore the connection and
close the channel.
}

Please let me know if any further information is required.

Thanks,

Virat



More information about the netty-users mailing list