Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

JBoss Microcontainer Beans

This example takes a POJO that was configured for JBoss AS 5/6 and tried to deploy it in JBoss AS7.

Please note that the POJO subsystem will be available with version AS 7.0.2.Final and to be able to run this example you'll either need a nightly build or build from source.


../gradlew build

Starting AS7



cp target/libs/mcbeans.jar /path/as7/standalone/deployments

Step 1: Deployment error

14:57:09,897 INFO  [] (MSC service thread 1-3) Starting deployment of "mcbeans.jar"
14:57:09,901 ERROR [] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."mcbeans.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."mcbeans.jar".PARSE: Failed to process phase PARSE of deployment "mcbeans.jar"
    at [jboss-as-server-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService( [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
    at org.jboss.msc.service.ServiceControllerImpl$ [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( [:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor$ [:1.6.0_26]
    at [:1.6.0_26]
Caused by: Failed to parse POJO xml ["/content/mcbeans.jar/META-INF/test-jboss-beans.xml"]
    at [jboss-as-server-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]
    ... 5 more
Caused by: ParseError at [row,col]:[3,1]
Message: Unexpected element '{urn:jboss:bean-deployer:2.0}deployment'
    at org.jboss.staxmapper.XMLMapperImpl.processNested(
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(
    ... 8 more

14:57:09,903 INFO  [] (DeploymentScanner-threads - 1) Deployment of "mcbeans.jar" was rolled back with failure message {"Failed services" => {"jboss.deployment.unit.\"mcbeans.jar\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"mcbeans.jar\".PARSE: Failed to process phase PARSE of deployment \"mcbeans.jar\""}}
14:57:09,906 INFO  [] (MSC service thread 1-1) Stopped deployment mcbeans.jar in 2ms
14:57:09,908 ERROR [] (DeploymentScanner-threads - 2) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.deployment.unit.\"mcbeans.jar\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"mcbeans.jar\".PARSE: Failed to process phase PARSE of deployment \"mcbeans.jar\""}}}}

What this says is that the element deployment with the namespace urn:jboss:bean-deployer:2.0 in not recognized. The namespace has changed with AS7 and should now be urn:jboss:mc:7.0 Open up test-jboss-beans.xml and add the correct namespace.

Now, rebuild the application and deploy once more. You should see the following in the server console:

15:02:25,180 INFO  [] (MSC service thread 1-4) Starting deployment of "mcbeans.jar"
15:02:25,215 INFO  [] (MSC service thread 1-3) added javax.persistence.api dependency to mcbeans.jar
15:02:25,279 INFO  [stdout] (MSC service thread 1-3) created TestBean
15:02:25,287 INFO  [se.rl.mcbeans.TestBean] (MSC service thread 1-4) start
15:02:25,292 INFO  [se.rl.mcbeans.TestBean] (MSC service thread 1-3) start
15:02:25,354 INFO  [] (DeploymentScanner-threads - 1) Deployed "mcbeans.jar"
You can’t perform that action at this time.