Uploaded image for project: 'JBoss Web'
  1. JBoss Web
  2. JBWEB-157

NPE in TomcatResolver for client-requests without a Host-Header when a HTTP_HOST-RewriteCond is configured.

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: JBossWeb-2.1.3.GA
    • Fix Version/s: JBossWeb-3.0.0.Beta2
    • Component/s: Rewrite Valve
    • Labels:
      None
    • Environment:

      JBoss 5.1.0.GA, Linux, SUN JDK 1.6.0_16

      Description

      Using the following RewriteValve-configuration and do a HTTP-request without a Host-Header generates a NPE (Some old HTTP1.0-clients and bots don't provide a Host-Header).
      --------------------------
      RewriteCond %

      {HTTP_HOST}

      www.domain.invalid
      RewriteRule .* - [F]
      --------------------------
      I reproduced this in JBossWeb2.1.3, but the bug is not yet fixed in trunk.

      Stacktrace:
      2010-01-08 16:26:27,845 ERROR [org.apache.catalina.connector.CoyoteAdapter] (http-0.0.0.0-9080-1) An exception or error occurred in the container during the request processing
      java.lang.NullPointerException
      at org.jboss.web.rewrite.TomcatResolver.resolve(TomcatResolver.java:59)
      at org.jboss.web.rewrite.Substitution$ServerVariableElement.evaluate(Substitution.java:63)
      at org.jboss.web.rewrite.Substitution.evaluate(Substitution.java:235)
      at org.jboss.web.rewrite.RewriteCond.evaluate(RewriteCond.java:198)
      at org.jboss.web.rewrite.RewriteRule.evaluate(RewriteRule.java:112)
      at org.jboss.web.rewrite.RewriteValve.invoke(RewriteValve.java:293)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:905)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:592)
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2036)
      at java.lang.Thread.run(Thread.java:619)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rmaucher Valued Customer
                  Reporter:
                  mgrieder Markus Grieder (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: