users@glassfish.java.net

Asynchronous Processing (request.startAsync()) + HTTPS

From: <glassfish_at_javadesktop.org>
Date: Thu, 15 Apr 2010 08:38:00 PDT

Hi,

I have the following simple Servlet:

[code]
@WebServlet(asyncSupported=true)
public class SimpleServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request,
                                      HttpServletResponse response)
                                      throws ServletException, IOException {

        AsyncContext ac = request.startAsync();
        ac.setTimeout(3000);
    }
}
[/code]

This works fine when called with HTTP on port 8080
(All that happens in this simplified version of my Servlet is, that we get a
timeout response "HTTP status 500" after 3 seconds, but that's not the point.)

However, when I call it with HTTPS (on the SSL enabled port 8181), I get an Exception:

[code]
SEVERE: ProtocolChain exception
java.lang.ClassCastException: org.apache.catalina.connector.Request$RequestAttachment cannot be cast to com.sun.grizzly.util.ThreadAttachment
        at com.sun.grizzly.filter.SSLReadFilter.saveSecuredBufferRemainders(SSLReadFilter.java:608)
        at com.sun.grizzly.filter.SSLReadFilter.postExecute(SSLReadFilter.java:214)
        at com.sun.grizzly.DefaultProtocolChain.postExecuteProtocolFilter(DefaultProtocolChain.java:164)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:637)
[/code]

After that, the connection hangs (I don't even get the HTTP 500 response).
Am I doing something wrong, does the server need additional setup or something?
(Servlets which don't call response.startAsync() do work with HTTPS on my server.)

I'm using Glassfish v3.0, with the default setup of "domain1".

Thanks
Chris
[Message sent by forum member 'chris_l']

http://forums.java.net/jive/thread.jspa?messageID=397180