JBossWeb RewriteValve throws IllegalArgumentException when using 'CO=NAME:VAL:domain[:lifetime[:path]]' flag in EAP 6

Solution Unverified - Updated -

Issue

When configuring the following RewriteValve setting using the flag 'CO=NAME:VAL:domain[:lifetime[:path]]':

<subsystem xmlns="urn:jboss:domain:web:2.1" default-virtual-server="default-host" native="false">
    <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
    <virtual-server name="default-host" enable-welcome-root="true">
        <alias name="localhost"/>
        <alias name="example.com"/>
        <rewrite name="rule-1" pattern="^/(.*)$" substitution="-" flags="CO=foo:bar:.example.com:60:/example">
            <condition name="condition-0" test="%{REQUEST_URI}" pattern=".*/example/.*"/>
        </rewrite>
    </virtual-server>
</subsystem>

JBossWeb RewriteValve throws the following IllegalArgumentException at JBoss EAP start-up:

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.web.host.default-host: org.jboss.msc.service.StartException in service jboss.web.host.default-host: java.lang.IllegalArgumentException: JBWEB007005: Error reading rewrite flags in line RewriteRule ^/(.*)$ - [CO=foo:bar:.example.com:60:/example] as CO=foo:bar:.example.com:60:/example
    at org.jboss.as.web.WebVirtualHostService.createRewriteValve(WebVirtualHostService.java:225)
    at org.jboss.as.web.WebVirtualHostService.start(WebVirtualHostService.java:88)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
Caused by: java.lang.IllegalArgumentException: JBWEB007005: Error reading rewrite flags in line RewriteRule ^/(.*)$ - [CO=foo:bar:.example.com:60:/example] as CO=foo:bar:.example.com:60:/example
    at org.jboss.web.rewrite.RewriteValve.parseRuleFlag(RewriteValve.java:718)
    at org.jboss.web.rewrite.RewriteValve.parse(RewriteValve.java:565)
    at org.jboss.web.rewrite.RewriteValve.parse(RewriteValve.java:208)
    at org.jboss.web.rewrite.RewriteValve.setConfiguration(RewriteValve.java:184)
    at org.jboss.as.web.WebVirtualHostService.createRewriteValve(WebVirtualHostService.java:223)
    ... 6 more

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.