Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JBWEB000250: Child container with name already exists

Tags:

tomcat

jboss

ant

I had deployed the ear in JBoss which consists of few war (Web Archive). Basically the deployed ear file was built by ant by setting TOMCAT_HOME prior to start the ant build.

set TOMCAT_HOME=C:\apache-tomcat-6.0.32

I'm getting following error. I deployed it in JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21)

11:38:34,340 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: 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:1936) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]

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

Caused by: java.lang.IllegalArgumentException: JBWEB000250: Child container with name already exists at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:794) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:353) 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.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.msc.service.ServiceControllerImpl.doInject(ServiceControllerImpl.java:1704) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.msc.service.ServiceControllerImpl.access$2000(ServiceControllerImpl.java:52) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.msc.service.ServiceControllerImpl$StartTask.performInjections(ServiceControllerImpl.java:1949) [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:1908) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] ... 3 more

This project is a legacy project. It has Struts 1.2.9, Springs-2.0.8, Hibernate-3.2.6 jar files in project lib directory and configurations for the same are available under \WEB-INF\ of Web Archives (.war).

Basically I am porting the Application from Websphere to JBoss

How can I solve or overcome this issue.

like image 934
Dev Anand Sadasivam Avatar asked Dec 09 '22 03:12

Dev Anand Sadasivam


2 Answers

In standalone.xml this will be true enable-welcome-root. If you make it false you can deploy a web archive .war in the / context....

If enable-welcome-root remains true, then some default jboss web page comes. Hence this needs to be corrected to deploy a web application in / context.

    <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="false">
            <alias name="localhost"/>
            <alias name="example.com"/>
        </virtual-server>
    </subsystem>
like image 55
Dev Anand Sadasivam Avatar answered Jan 11 '23 10:01

Dev Anand Sadasivam


This problem occurs because of occurrence of same .war file in both .ear file as well as inside of some .war file.

In my case .war has a recurrence as a jars with the same name of some .war files under one .war\WEB-INF\lib. And those .jar's has everything replicated except web folder removed. I hope this has been done to refer some java files across. NOW, I had removed those .jars. And now I am not getting this specific error.

So, for now, I sorted out this error JBWEB000250: Child container with name already exists..

There is nothing harm in building ant targets by setting TOMCAT_HOME.

But it may have some implications as Web Container varies.

like image 43
Dev Anand Sadasivam Avatar answered Jan 11 '23 11:01

Dev Anand Sadasivam