Reputation: 753
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.
Upvotes: 4
Views: 10510
Reputation: 1
To solve this problem just stop the server JBOSS, navigate to the directory server within standalone / deployments and delete the .war project. Then just add the project again on the server and you are done.
Upvotes: -1
Reputation: 753
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>
Upvotes: 15
Reputation: 753
JBoss is not allowing to deploy any .war in /
context.... We should give some web context name... for example /scweb
or so..... Then it succeeds....
.ear\META-INF\application.xml
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
version="1.4">
<display-name>PCB Application</display-name>
<module>
<web>
<web-uri>scWeb-1.1.war</web-uri>
<context-root>/scWeb</context-root>
</web>
</module>
</application>
I hope there is some default-host
deployed in /
For that reason only I hope it says like....
Caused by: java.lang.IllegalArgumentException: JBWEB000250: Child container with name already exists
To overcome this error I removed all .jar
server side classes which were put for dependency injections..... Later I realized that .jar
wasn't the cause of the error.... I was confused as this error had come for some web-context as well... That maybe because of fast interpretation of error probably and I am not sure....
This error was just for the default-host
.... Or it maybe because I have some lm-shared.jar
under .ear\META-INF\lib
Correct me if am wrong.... Give me some write-up, if cause of this error can be something else....
Upvotes: 0
Reputation: 753
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.
Upvotes: 1