Wicket application throws IllegalStateException when bound to multiple JBoss virtual hosts

Solution Verified - Updated -

Issue

  • Our application using wicket is bound to two virtual hosts in its WEB-INF/jboss-web.xml:

    <virtual-host>externalhost</virtual-host>
    <virtual-host>localhost</virtual-host>
    

    When the application is deployed, we see the following IllegalStateException:

    ERROR [org.apache.wicket.protocol.http.WicketFilter] (main) The initialization of an application with name 'helloworld' has failed.
    java.lang.IllegalStateException: Application with name 'helloworld' already exists.'
        at org.apache.wicket.Application.setName(Application.java:870)
        at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:388)
        at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:234)
        at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:332)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:90)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3783)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4409)
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:313)
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:149)
        at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
        at org.jboss.web.deployers.WebModule.startModule(WebModule.java:122)
        at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
    

Environment

  • JBoss Enterprise Application Platform (EAP) 5.x
  • Wicket 6.16

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content