2 Replies Latest reply on Jan 22, 2009 1:22 PM by starksm64

    Multiple virtual hosts with root context broken?

    scytayl

      Hi,

      First off, I'll note that this problem has already been documented here without resolution: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=121311. Essentially, it seems that stricter checking in JBoss 5 has made it impossible to deploy 2 webapps to the root context even if they are configured to run under different virtual hosts.

      In jboss-web.xml:
      App1:

      <jboss-web>
       <context-root>/</context-root>
       <virtual-host>app1.host.com</virtual-host>
      </jboss-web>
      


      App2:
      <jboss-web>
       <context-root>/</context-root>
       <virtual-host>app2.host.com</virtual-host>
      </jboss-web>
      


      In server.xml:
      <Engine .....>
       ....
       <Host name="app1.host.com"/>
       <Host name="app2.host.com"/>
      </Engine>
      


      The exception on deploying the second app is as follows:
      org.jboss.deployers.spi.DeploymentException: Error deploying: jboss.web.deployment:war=/
       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentExcept
      .....
      Caused by: java.lang.IllegalStateException: jboss.web.deployment:war=/ is already installed.
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:716)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
       at org.jboss.system.ServiceController.doInstall(ServiceController.java:670)
      


      This is a show-stopper for me - these apps need to run under the root context, as they have been doing since JBoss 2. This should not cause conflict, since they should run under different virtual hosts.

      Any help would be most appreciated - I'm unable to proceed with JBoss 5 without resolving this.

      Thanks,
      Craig

      PS I notice application.xml in my EAR doesn't seem to be read anymore, so I assume one can no longer set the <context-root> there, but must now do it in jboss-web.xml?

        • 1. Re: Multiple virtual hosts with root context broken?
          elponderador

          I have also experienced this problem as we were anxious to anaylize the modifications we need to make to move to JBoss 5.

          It seems that they decided to strictly implement the application.xml now as well, so that in a single ear it will fail the ear deployment if there are more than one wars with the same context even though they belong to different virtual hosts, since the virtual-host element was usable in the application.xml in 4.2 but not in 5.

          Any idea on whether this situation is being considered and if a solution for it is being created?

          Any help or pointers would be greatly appreciated
          Thanks,
          Elponderador

          • 2. Re: Multiple virtual hosts with root context broken?
            starksm64

            This has been fixed for the upcoming 5.0.1.GA release.