First off, I'm sorry if this is the wrong place, but there is no 
httpcomponents-user list, and I am not using HttpClient.

I based my server on the "Basic non-blocking HTTPS server" example at 
http://jakarta.apache.org/httpcomponents/httpcomponents-core/examples.html, and 
I'm using 4.0-alpha4 running on JDK 6.

All I ever get hit with is a simple URL with a few parameters on it, and I just 
respond with SC_OK. We are currently in development, so my server usually just 
gets hit from a couple times a day to maybe 10 times.

It usually runs fine, but the other day the following errors came out on 
System.err:

Exception in thread "I/O reactor worker thread 1" 
java.lang.IllegalStateException: Internal error
    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.initHandshaker(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(Unknown Source)
    at javax.net.ssl.SSLEngine.unwrap(Unknown Source)
    at 
org.apache.http.impl.nio.reactor.SSLIOSession.decryptData(SSLIOSession.java:239)
    at 
org.apache.http.impl.nio.reactor.SSLIOSession.isAppInputReady(SSLIOSession.java:258)
    at 
org.apache.http.impl.nio.reactor.SSLServerIOEventDispatch.inputReady(SSLServerIOEventDispatch.java:122)
    at 
org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:68)
    at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:160)
    at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:145)
    at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:127)
    at 
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:153)
    at java.lang.Thread.run(Unknown Source)
Exception in thread "I/O reactor worker thread 2" 
java.lang.IllegalStateException: Internal error
    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.initHandshaker(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(Unknown Source)
    at javax.net.ssl.SSLEngine.unwrap(Unknown Source)
    at 
org.apache.http.impl.nio.reactor.SSLIOSession.doHandshake(SSLIOSession.java:155)
    at 
org.apache.http.impl.nio.reactor.SSLIOSession.isAppInputReady(SSLIOSession.java:257)
    at 
org.apache.http.impl.nio.reactor.SSLServerIOEventDispatch.inputReady(SSLServerIOEventDispatch.java:122)
    at 
org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:68)
    at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:160)
    at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:145)
    at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:127)
    at 
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:153)
    at java.lang.Thread.run(Unknown Source)

This did NOT come through the EventListener that was set in the handler, so my 
code does not receive any warning that there was a problem, but from that point 
on, there were no threads listening on the SSL port.

This, of course, is bad. :-) My app has basically crashed and I know nothing 
about it except that something got printed to System.err. Even that doesn't let 
me know that it was a fatal error that crashed the worker threads.

When I look at the SVN source, I see that the code only catches IOException, 
but doesn't handle Throwable, which is why I didn't get notified of the 
Exception, since IllegalStateException is a RuntimeException.

So, of course, I have some questions.

Why was an IllegalStateException thrown? Do these "reactor worker threads" have 
a limited shelf life, and have to be "exercised" every once it a while? It is 
possible my server had been idle for a couple days at that point.

Why isn't Throwable caught and handled in SSLServerIOEventDispatch? Wouldn't it 
make sense to convert it to a IOException so the application can be notified 
that there was a problem ("this.handler.exception(new IOException("Unknown 
exception", throwable));sslSession.shutdown();")?

If for some reason it just isn't considered acceptable to convert a 
RuntimeException to an IOException, how do I detect this situation and recover 
from it?

If it IS acceptable to do that, and I get notified via 
EventListener.fatalIOException(), how do I recover from the situation? Can I 
detect that a worker thread has died, and if so, can I restart it, or start a 
new one? If so, how?
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to