Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-21269

[GSS](7.4.z) UNDERTOW-1849 - NPE happens at StoredResponseStreamSinkConduit.terminateWrites when StoredResponseHandler (store-response) is enabled

    XMLWordPrintable

    Details

    • Target Release:
    • Steps to Reproduce:
      Hide

      1. Enable StoredResponseHandler (store-response) with RequestDumpingHandler (dump-request) to dump request and response information (both header and body) in the undertow subsystem in standalone.xml

          <server name="default-server">
              ... 
              <host name="default-host" alias="localhost">
                  ... 
                  <filter-ref name="dump-request-and-response-filter"/> <!-- add this --> 
              </host>
          </server>
          ... 
          <filters>
              <expression-filter name="dump-request-and-response-filter" expression="dump-request;eager-form-parser;store-response;"/> <!-- add this --> 
          </filters>
      

      2. Deploy a web application like https://github.com/jboss-developer/jboss-eap-quickstarts/tree/7.3.x/helloworld-rs

      3. Send a request

      $ curl -v http://localhost:8080/helloworld-rs/rest/xml
      

      RequestDumpingHandler works fine to dump request/response in sever.log, but you will see NullPointerException at io.undertow.conduits.StoredResponseStreamSinkConduit.terminateWrites().

      Show
      1. Enable StoredResponseHandler (store-response) with RequestDumpingHandler (dump-request) to dump request and response information (both header and body) in the undertow subsystem in standalone.xml <server name= " default -server" > ... <host name= " default -host" alias= "localhost" > ... <filter-ref name= "dump-request-and-response-filter" /> <!-- add this --> </host> </server> ... <filters> <expression-filter name= "dump-request-and-response-filter" expression= "dump-request;eager-form-parser;store-response;" /> <!-- add this --> </filters> 2. Deploy a web application like https://github.com/jboss-developer/jboss-eap-quickstarts/tree/7.3.x/helloworld-rs 3. Send a request $ curl -v http: //localhost:8080/helloworld-rs/ rest /xml RequestDumpingHandler works fine to dump request/response in sever.log, but you will see NullPointerException at io.undertow.conduits.StoredResponseStreamSinkConduit.terminateWrites().
    • QE Test Coverage:
      +

      Description

      When StoredResponseHandler (store-response) is enabled to dump response body with RequestDumpingHandler (dump-request), NullPointerException happens at io.undertow.conduits.StoredResponseStreamSinkConduit.terminateWrites() at the end of the request processing.

      ERROR [io.undertow.request] (default task-1) UT005071: Undertow request failed HttpServerExchange{ GET /helloworld-rs/rest/xml}: java.lang.NullPointerException
      	at io.undertow.conduits.StoredResponseStreamSinkConduit.terminateWrites(StoredResponseStreamSinkConduit.java:148)
      	at org.xnio.conduits.ConduitStreamSinkChannel.shutdownWrites(ConduitStreamSinkChannel.java:178)
      	at io.undertow.channels.DetachableStreamSinkChannel.shutdownWrites(DetachableStreamSinkChannel.java:79)
      	at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:618)
      	at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:534)
      	at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:623)
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:328)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access(ServletInitialHandler.java:78)
      	at io.undertow.servlet.handlers.ServletInitialHandler.call(ServletInitialHandler.java:133)
      	at io.undertow.servlet.handlers.ServletInitialHandler.call(ServletInitialHandler.java:130)
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction.call(ServletRequestContextThreadSetupAction.java:48)
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction.call(ContextClassLoaderSetupAction.java:43)
      	at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create(SecurityContextThreadSetupAction.java:105)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1530)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1530)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1530)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1530)
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access(ServletInitialHandler.java:78)
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:99)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:370)
      	at io.undertow.server.HttpServerExchange.run(HttpServerExchange.java:830)
      	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at org.xnio.XnioWorker$WorkerThreadFactory.run(XnioWorker.java:1280)
      	at java.lang.Thread.run(Thread.java:748)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              istudens Ivo Studensky
              Reporter:
              ivassile Ilia Vassilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: