1 Reply Latest reply: May 8, 2012 3:42 PM by such RSS

    JBoss 7.1.1 - Not able to set app to root context using jboss-web.xml

    such Newbie

      Hi

       

      I have the following jboss-web.xml in my app to set root context.

       

      <?xml version="1.0" encoding="UTF-8"?>

       

      <!DOCTYPE jboss-web PUBLIC

          "-//JBoss//DTD Web Application 4.2//EN"

          "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">

       

      <jboss-web>

              <context-root>/</context-root>

      </jboss-web>

       

       

      But I am getting this exception:

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-16) MSC00001: Failed to start service jboss.web.deployment.default-host./: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./: Failed to start service

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

      Caused by: java.lang.IllegalArgumentException: Child container with name  already exists

          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:804)

          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:792)

          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:356)

          at org.jboss.as.web.deployment.WebContextInjector.inject(WebContextInjector.java:62)

          at org.jboss.as.web.deployment.WebContextInjector.inject(WebContextInjector.java:38)

          at org.jboss.msc.inject.CastingInjector.inject(CastingInjector.java:55) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl.doInject(ServiceControllerImpl.java:1549) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl.access$1900(ServiceControllerImpl.java:49) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.performInjections(ServiceControllerImpl.java:1780) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1741) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          ... 3 more

       

      Any idea?

       

      Thanks

        • 1. Re: JBoss 7.1.1 - Not able to set app to root context using jboss-web.xml
          such Newbie

          Never mind. I got the solution.

           

          I disabled the default 'welcome' content, which is deployed in the root context by default.

           

          <subsystem xmlns="urn:jboss:domain:web:1.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="false">

                          <alias name="localhost"/>

                          <alias name="example.com"/>

                      </virtual-server>

          </subsystem>

           

           

          Thanks