NullPointerException in JBoss Web due to JBWEB-157
Issue
- I've set up RewriteRules like the following using HTTP_HOST:
RewriteCond %{HTTP_HOST} ^(?:www\.)?someDomain\.com [OR,NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?someOther\.com [OR,NC]
- Now I see the following exception:
ERROR [org.apache.catalina.connector.CoyoteAdapter] (http-192.168.111.130-80-2) 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.RewriteRule.evaluate(RewriteRule.java:140)
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.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:662)
*Getting a NullPointerException due to https://issues.jboss.org/browse/JBWEB-157 when adding rules like:
RewriteCond %{HTTP_HOST} ^(?:www\.)?someDomain\.com [OR,NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?someOther\.com [OR,NC]
ERROR [http-127.0.0.1-8080-3] [org.apache.catalina.connector.CoyoteAdapter] 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)
Environment
- JBoss Enterprise Application Platform (EAP) 5.1.0
- JBoss Web 2.1.10_GA
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.