JBoss Web
  1. JBoss Web
  2. JBWEB-188

After removing the ROOT.war, NPE occurs and 200 OK is returned when browsing to a non existing path

    Details

    • Type: Bug Bug
    • Status: Open Open (View Workflow)
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Tomcat
    • Security Level: Public (Everyone can see)
    • Labels:
    • Environment:
      JBossWeb-2.0.0.GA_CP14 which come with EAP 4.2 CP09 and EAP 4.3 CP08
    • Affects:
      Release Notes
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Create an empty ROOT.war in $JBOSS_HOME/server/$PROFILE/deploy/jboss-web.deployer/

      Show
      Create an empty ROOT.war in $JBOSS_HOME/server/$PROFILE/deploy/jboss-web.deployer/
    • Steps to Reproduce:
      Hide

      1. Remove ROOT.war in $JBOSS_HOME/server/$PROFILE/deploy/jboss-web.deployer
      2. Then use curl to browse to a non existing path like:
      $ curl -v http://localhost:8080/XXXX
      3. Then the console and server.log shows the NPE and empty page with http status code 200 OK is returned

      Show
      1. Remove ROOT.war in $JBOSS_HOME/server/$PROFILE/deploy/jboss-web.deployer 2. Then use curl to browse to a non existing path like: $ curl -v http://localhost:8080/XXXX 3. Then the console and server.log shows the NPE and empty page with http status code 200 OK is returned
    • Similar Issues:
      Show 9 results 

      Description

      After removing the ROOT.war, the server behaves as if it exists (200 OK is returned and page is loaded empty) and the console shows the following NPE when browsing to a non existing path.

      ERROR [CoyoteAdapter] An exception or error occurred in the container during the request processing
      java.lang.NullPointerException
      at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:507)
      at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:449)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:239)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:636)

        Issue Links

          Activity

          Hide
          Masafumi Miura
          added a comment -

          Please backport the following NULL checks (line 489 - 498) to JBOSSWEB_2_0_0_GA_CP branch from 2.1.x branch.

          http://anonsvn.jboss.org/repos/jbossweb/branches/2.1.x/java/org/apache/catalina/connector/CoyoteAdapter.java

          377 protected boolean postParseRequest(org.apache.coyote.Request req,
          378 Request request,
          379 org.apache.coyote.Response res,
          380 Response response)
          381 throws Exception {
          ...(snip)...
          489 if (request.getMappingData().host == null)

          { 490 res.setStatus(400); 491 res.setMessage("Host not mapped"); 492 return false; 493 }

          494 if (request.getMappingData().context == null)

          { 495 res.setStatus(404); 496 res.setMessage("Context not mapped"); 497 return false; 498 }

          ...(snip)...
          546 // Parse session Id
          547 parseSessionCookiesId(req, request);
          548
          549 return true;
          550 }

          ...(snip)...

          599 protected void parseSessionCookiesId(org.apache.coyote.Request req, Request request) {
          600
          601 // If session tracking via cookies has been disabled for the current
          602 // context, don't go looking for a session ID in a cookie as a cookie
          603 // from a parent context with a session ID may be present which would
          604 // overwrite the valid session ID encoded in the URL
          605 if (!((Context)request.getMappingData().context).getCookies())
          606 return;
          607
          ...(snip)...

          Show
          Masafumi Miura
          added a comment - Please backport the following NULL checks (line 489 - 498) to JBOSSWEB_2_0_0_GA_CP branch from 2.1.x branch. http://anonsvn.jboss.org/repos/jbossweb/branches/2.1.x/java/org/apache/catalina/connector/CoyoteAdapter.java 377 protected boolean postParseRequest(org.apache.coyote.Request req, 378 Request request, 379 org.apache.coyote.Response res, 380 Response response) 381 throws Exception { ...(snip)... 489 if (request.getMappingData().host == null) { 490 res.setStatus(400); 491 res.setMessage("Host not mapped"); 492 return false; 493 } 494 if (request.getMappingData().context == null) { 495 res.setStatus(404); 496 res.setMessage("Context not mapped"); 497 return false; 498 } ...(snip)... 546 // Parse session Id 547 parseSessionCookiesId(req, request); 548 549 return true; 550 } ...(snip)... 599 protected void parseSessionCookiesId(org.apache.coyote.Request req, Request request) { 600 601 // If session tracking via cookies has been disabled for the current 602 // context, don't go looking for a session ID in a cookie as a cookie 603 // from a parent context with a session ID may be present which would 604 // overwrite the valid session ID encoded in the URL 605 if (!((Context)request.getMappingData().context).getCookies()) 606 return; 607 ...(snip)...

            People

            • Assignee:
              Remy Maucherat
              Reporter:
              Masafumi Miura
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: