Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-213

ClassCastException when SSL session tracking mode and AJP connector used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.0.4.Final, 1.1.Beta1
    • 1.0.0.Final
    • AJP
    • None
    • Hide

      Setup Apache + mod_proxy and an AJP connector in WildFly, wire it all together. Deploy a simple application that uses SSL session tracking mode (such as: https://github.com/tknyziak/ajp-ssl-session-cce) and try to access it through Apache.

      Show
      Setup Apache + mod_proxy and an AJP connector in WildFly, wire it all together. Deploy a simple application that uses SSL session tracking mode (such as: https://github.com/tknyziak/ajp-ssl-session-cce ) and try to access it through Apache.

    Description

      In the mentioned setup (HTTPD --> mod_proxy --> AJP --> Undertow in Wildfly), when the web application running on the WildFly server uses SSL session tracking mode, any attempt to access it crashes with a ClassCastException, like this:

      2014-04-02 16:59:16,020 ERROR [io.undertow.request] (default task-9) Blocking request failed HttpServerExchange
      { GET /ajp-ssl-session-cce/index.html}: java.lang.ClassCastException: io.undertow.server.protocol.ajp.AjpServerConnection 
      cannot be cast to io.undertow.server.protocol.http.HttpServerConnection
              at io.undertow.server.session.SslSessionConfig.findSessionId(SslSessionConfig.java:71)
              at org.wildfly.extension.undertow.session.CodecSessionConfig.findSessionId(CodecSessionConfig.java:56)
              at io.undertow.server.session.InMemorySessionManager.getSession(InMemorySessionManager.java:139)
              at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:673)
              at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:692)
              at io.undertow.servlet.spec.ServletContextImpl.updateSessionAccessTime(ServletContextImpl.java:696)
              at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:522)
              at io.undertow.servlet.spec.HttpServletResponseImpl.sendError(HttpServletResponseImpl.java:137)
              at io.undertow.servlet.spec.HttpServletResponseImpl.sendError(HttpServletResponseImpl.java:142)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:273)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0]
              at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0]
      

      Changing the tracking mode to COOKIE fixes the problem.

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            t.knyziak@gmail.com Tomasz Knyziak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: