Search code examples
springdeploymentjbossjboss7.x

Spring application in JBoss AS 7.1.1: Unexpected element: beans


I am trying to migrate a small web application from Tomcat 7 to JBoss AS 7.1.1.Final. It's based on Spring Framework 3.2.16.RELEASE and runs well in Tomcat 7.

However when I deploy it to JBoss I get the following error:

16:23:24,973 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."myapp.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myapp.war".PARSE: Failed to process phase PARSE of deployment "myapp.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: IJ010061: Unexpected element: beans
    at org.jboss.as.connector.deployers.processors.DsXmlDeploymentParsingProcessor.deploy(DsXmlDeploymentParsingProcessor.java:85)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more
Caused by: org.jboss.jca.common.metadata.ParserException: IJ010061: Unexpected element: beans
    at org.jboss.jca.common.metadata.ds.DsParser.parse(DsParser.java:123)
    at org.jboss.jca.common.metadata.ds.DsParser.parse(DsParser.java:82)
    at org.jboss.as.connector.deployers.processors.DsXmlDeploymentParsingProcessor.deploy(DsXmlDeploymentParsingProcessor.java:80)
    ... 6 more

I tried to google it, but no luck so far. Any idea?


Solution

  • You probably have some file named *-ds.xml in your war deployment.

    Probably inside WEB-INF directory WildFly (& jboss as7+) threats this files as datasource definition and as such it is expecting certain xml structure.

    In you case you probably have something else in this file that it cannot understand. Best way is to either remove this file or just rename it to not be *-ds.xml if you need it for some config/resource in your application.