6 Replies Latest reply on Jan 13, 2012 7:47 PM by Stephen Coy

    Does JBoss 7.1 beta include support for EJB 2.0?

    Amit Yadav Newbie

      It gives below exception when deploying a test application using EJB2.0:

       

      23:11:17,921 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."EJBApplication.ea

      r"."EJBApplicationEJB.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."EJBApplication.ear"."EJBApplicationEJB.jar

      ".PARSE: Failed to process phase PARSE of subdeployment "EJBApplicationEJB.jar" of deployment "EJBApplication.ear"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.Beta1b.jar:]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [:1.6.0_07]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [:1.6.0_07]

              at java.lang.Thread.run(Thread.java:619) [:1.6.0_07]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Exception while parsing ejb-jar.xml: /C:/jboss-7.1.0/bin/content/EJBAppli

      cation.ear/EJBApplicationEJB.jar/META-INF/ejb-jar.xml

              at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.parseEjbJarXml(EjbJarParsingDeploymentUnitProcessor.java:238)

              at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.deploy(EjbJarParsingDeploymentUnitProcessor.java:113)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.Beta1b.jar:]

              ... 5 more

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[20,4]

      Message: Unexpected element 'acknowledge-mode' encountered

              at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:108)

              at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElement(AbstractMetaDataParser.java:53)

              at org.jboss.metadata.ejb.parser.spec.AbstractNamedMetaDataWithDescriptionGroupParser.processElement(AbstractNamedMetaDataWithDescriptionGroup

      Parser.java:66)

              at org.jboss.metadata.ejb.parser.spec.AbstractEnterpriseBeanMetaDataParser.processElement(AbstractEnterpriseBeanMetaDataParser.java:84)

              at org.jboss.metadata.ejb.parser.spec.AbstractMessageDrivenBeanParser.processElement(AbstractMessageDrivenBeanParser.java:93)

              at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.processElement(MessageDrivenBean31Parser.java:76)

              at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.processElement(MessageDrivenBean31Parser.java:36)

              at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)

              at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.parse(MessageDrivenBean31Parser.java:43)

              at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.processElement(EnterpriseBeansMetaDataParser.java:100)

              at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.processElement(EnterpriseBeansMetaDataParser.java:39)

              at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)

              at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.parse(EnterpriseBeansMetaDataParser.java:75)

              at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.parse(EnterpriseBeansMetaDataParser.java:67)

              at org.jboss.metadata.ejb.parser.spec.AbstractEjbJarMetaDataParser.processElement(AbstractEjbJarMetaDataParser.java:111)

              at org.jboss.metadata.ejb.parser.spec.AbstractEjbJarMetaDataParser.processElement(AbstractEjbJarMetaDataParser.java:38)

              at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)

              at org.jboss.metadata.ejb.parser.spec.EjbJarMetaDataParser.parseDocument(EjbJarMetaDataParser.java:109)

              at org.jboss.metadata.ejb.parser.spec.EjbJarMetaDataParser.parse(EjbJarMetaDataParser.java:53)

              at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.parseEjbJarXml(EjbJarParsingDeploymentUnitProcessor.java:235)

              ... 7 more

       

      Thanks

        • 1. Re: Does JBoss 7.1 beta include support for EJB 2.0?
          jaikiran pai Master

          Yes, it does. It looks like you have an incorrect ejb-jar.xml (one which doesn't follow the xsd).

          • 2. Re: Does JBoss 7.1 beta include support for EJB 2.0?
            Amit Yadav Newbie

            Thanks for replying, Jaikiran.

             

            Below is ejb-jar.xml I am using in my test application:

            --------------------------------------------------------------------

             

            <?xml version="1.0" encoding="UTF-8"?>

            <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

             

            <ejb-jar>

                <enterprise-beans>

                    <session>

                        <ejb-name>TestSessionBean</ejb-name>

                        <home>testexample.ITestSessionHome</home>

                        <remote>testexample.ITestSessionRemote</remote>

                        <ejb-class>testexample.TestSessionBean</ejb-class>

                        <session-type>Stateless</session-type>

                        <transaction-type>Container</transaction-type>

                    </session>

                    <entity>

                        <ejb-name>TestEntityBean</ejb-name>

                        <home>testexample.ITestEntityHome</home>

                        <remote>testexample.ITestEntityRemote</remote>

                        <ejb-class>testexample.TestEntityBean</ejb-class>

                        <persistence-type>Bean</persistence-type>

                        <prim-key-class>testexample.TestPK</prim-key-class>

                        <reentrant>False</reentrant>

                    </entity>

                    <message-driven>

                        <description>Test MDB</description>

                        <ejb-name>TestMDB</ejb-name>

                        <ejb-class>testexample.TestMDB</ejb-class>

                        <transaction-type>Container</transaction-type>

                        <acknowledge-mode>Auto-acknowledge</acknowledge-mode>

                        <message-driven-destination>

                            <destination-type>javax.jms.Queue</destination-type>

                        </message-driven-destination>

                    </message-driven>

                </enterprise-beans>

            </ejb-jar>

            --------------------------------------------------------------------

             

            It is correct as I have already validated this xml against DTD available at http://java.sun.com/dtd/ejb-jar_2_0.dtd. So no issues in ejb-jar.xml.

            • 3. Re: Does JBoss 7.1 beta include support for EJB 2.0?
              Siew Khim Thin Newbie

              I'm having the same problem with jboss 7.0.2.Final. It is working perfectly with jboss 4.2.3.GA.

               

              Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2209,10]

              Message: Unexpected element 'acknowledge-mode' encountered

                  at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:109)

                  at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElement(AbstractMetaDataParser.java:53)

                  at org.jboss.metadata.ejb.parser.spec.AbstractNamedMetaDataWithDescriptionGroupParser.processElement(AbstractNamedMetaDataWithDescriptionGroupParser.java:56)

                  at org.jboss.metadata.ejb.parser.spec.AbstractEnterpriseBeanMetaDataParser.processElement(AbstractEnterpriseBeanMetaDataParser.java:84)

                  at org.jboss.metadata.ejb.parser.spec.AbstractMessageDrivenBeanParser.processElement(AbstractMessageDrivenBeanParser.java:93)

                  at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.processElement(MessageDrivenBean31Parser.java:73)

                  at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.processElement(MessageDrivenBean31Parser.java:34)

                  at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)

                  at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.parse(MessageDrivenBean31Parser.java:40)

                  at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.parse(EnterpriseBeansMetaDataParser.java:75)

                  at org.jboss.metadata.ejb.parser.spec.AbstractEjbJarMetaDataParser.processElement(AbstractEjbJarMetaDataParser.java:111)

                  at org.jboss.metadata.ejb.parser.spec.AbstractEjbJarMetaDataParser.processElement(AbstractEjbJarMetaDataParser.java:38)

                  at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:65)

                  at org.jboss.metadata.ejb.parser.spec.EjbJarMetaDataParser.parseDocument(EjbJarMetaDataParser.java:106)

                  at org.jboss.metadata.ejb.parser.spec.EjbJarMetaDataParser.parse(EjbJarMetaDataParser.java:58)

                  at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.parseEjbJarXml(EjbJarParsingDeploymentUnitProcessor.java:224)

              • 4. Re: Does JBoss 7.1 beta include support for EJB 2.0?
                Stephen Coy Master

                This is a bug in the parser.

                 

                The acknowledge-mode element disappeared from the schema between EJB 2.1 and EJB 3.0 as it was replaced by an activation-config property.

                 

                org.jboss.metadata.ejb.parser.spec.AbstractMessageDrivenBeanParser.processElement(MD, XMLStreamReader) does not look for it at all.