9 Replies Latest reply on Sep 11, 2014 9:22 AM by ctomc

    NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl

    gytis

      Hello,

       

      for the last month we have been seeing an intermittent failure on Narayana CI job caused by the NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl. It happens on the multi-thread WS-AT test, which makes 10 concurrent webservice invocations. Error comes from the following execution chain:

      {code}

      io.undertow.servlet.spec.HttpServletRequestImpl#getRemotePort()

        io.undertow.server.HttpServerExchange#getSourceAddress()

        org.xnio.Connection#getPeerAddress(InetSocketAddress.class)

        org.xnio.nio.NioSocketStreamConnection#getPeerAddress()

        conduit.getSocketChannel().socket().getRemoteSocketAddress()

      {code}

      Last line returns null, and causes io.undertow.servlet.spec.HttpServletRequestimpl#getRemotePort() to throw NPE when it executes exchange.getSourceAddress().getPort().

       

      It looks like a bug not related with Narayana. However, I wanted to confirm here before raising it with WildFly. Currently this is files as a Narayana issue: [JBTM-2193] NullPointerException in ThreadedTransactionTest - JBoss Issue Tracker

        • 1. Re: NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl
          ctomc

          Version of WildFly?

           

          also do you have any proper stacktrace with linenumber?

          • 2. Re: Re: NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl
            gytis

            I use WildFly upstream.

            Exception stack trace is bellow and full test output is attached.

             

             [0m [33m09:49:54,569 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default task-38) Interceptor for {http://docs.oasis-open.org/ws-tx/wsat/2006/06}CompletionCoordinatorService#{http://docs.oasis-open.org/ws-tx/wsat/2006/06}CommitOperation has thrown exception, unwinding now: java.lang.NullPointerException
              at io.undertow.servlet.spec.HttpServletRequestImpl.getRemotePort(HttpServletRequestImpl.java:876)
              at org.apache.cxf.transport.http.HttpServletRequestSnapshot.<init>(HttpServletRequestSnapshot.java:91)
              at org.apache.cxf.transport.http.AbstractHTTPDestination$1.cacheInput(AbstractHTTPDestination.java:285)
              at org.apache.cxf.interceptor.OneWayProcessorInterceptor.handleMessage(OneWayProcessorInterceptor.java:95) [cxf-api-2.7.11.jar:2.7.11]
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) [cxf-api-2.7.11.jar:2.7.11]
              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-api-2.7.11.jar:2.7.11]
              at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:241)
              at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:97)
              at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:131)
              at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
              at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)
              at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
              at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:247)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:234)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:153)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:737)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
              at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]
            
            • 3. Re: Re: NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl
              tomjenkinson

              Hi Tomaz,

               

              We are actually on this version of WildFly: Merge pull request #6388 from bstansberry/fix-msg · 545dada · wildfly/wildfly · GitHub

               

              We have not tracked master for the last month during the build split as some commits were added that made our additional subsystem break so we are waiting for the build split to settle before we continue tracking master again.

               

              Tom

              • 4. Re: Re: NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl
                gytis

                I did test it with WildFly master this morning and it also failed.

                • 5. Re: Re: NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl
                  ctomc

                  It looks like you guys are hitting https://issues.jboss.org/browse/XNIO-213

                   

                  which is already fixed in xnio, but not yet released.

                  • 6. Re: NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl
                    gytis

                    Thanks, Tomaz. This looks like our problem. Any idea when it is going to end up in WildFly?

                    • 8. Re: NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl
                      gytis

                      Thanks Tomaz.

                      • 9. Re: NullPointerException from io.undertow.servlet.spec.HttpServletRequestImpl
                        ctomc

                        It took bit longer, but this fix is now part of wildfly codebase