JBoss deployment fails because "An element of this type named 'VIRTUAL_HOST' has already been declared"
Issue
- Our application fails to deploy on JBoss due to the following error:
ERROR [MSC service thread 1-1][org.jboss.msc.service.fail] MSC000001: Failed to start service jboss.deployment.subunit."application.ear"."helloworld.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."application.ear"."helloworld.war".PARSE: JBAS018733: Failed to process phase PARSE of subdeployment "helloworld.war" of deployment "application.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018014: Failed to parse XML descriptor "/opt/jboss-eap-6.0/standalone/deployments/application.ear/helloworld.war/WEB-INF/jboss-web.xml" at [4,2]
at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:79)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[4,2]
Message: An element of this type named 'VIRTUAL_HOST' has already been declared
at org.jboss.metadata.parser.util.MetaDataElementParser.duplicateNamedElement(MetaDataElementParser.java:248)
at org.jboss.metadata.parser.jbossweb.JBossWebMetaDataParser.parse(JBossWebMetaDataParser.java:130)
at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:71)
... 6 more
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.