1 Reply Latest reply on Dec 1, 2011 8:52 AM by Alexey Makhmutov

    Unable to deploy EJB 2.1 including message-driven beans on JBoss AS 7.1.0 Beta

    Bruno Jensen Newbie

      I managed to migrate a simple application (packaged in an ear file) only including a couple of stateless session beans, from JBoss 4 to 7.1.o Beta.

      When deploying a larger application (ear file) including Message Driven Beans I get a parser error in the log:

       

       

      {code} 12:49:28,426 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "BtsSearchejb.jar"
      12:49:28,457 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) MSC00001: Failed to start service jboss.deployment.subunit."BtsSearch.ear"."BtsSearchejb.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."BtsSearch.ear"."BtsSearchejb.jar".PARSE: Failed to process phase PARSE of subdeployment "BtsSearchejb.jar" of deployment "BtsSearch.ear"
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.Beta1.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(Unknown Source) [:1.6.0_24]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_24]
      at java.lang.Thread.run(Unknown Source) [:1.6.0_24]
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Exception while parsing ejb-jar.xml: /c:/jboss-as-7.1.0.Beta1/jboss-as-7.1.0.Beta1/bin/content/BtsSearch.ear/BtsSearchejb.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.Beta1.jar:]
      ... 5 more
      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2652,7]
      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(AbstractNamedMetaDataWithDescriptionGroupParser.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.12:49:28,426 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "BtsSearchejb.jar"
      12:49:28,457 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) MSC00001: Failed to start service jboss.deployment.subunit."BtsSearch.ear"."BtsSearchejb.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."BtsSearch.ear"."BtsSearchejb.jar".PARSE: Failed to process phase PARSE of subdeployment "BtsSearchejb.jar" of deployment "BtsSearch.ear"
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.Beta1.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(Unknown Source) [:1.6.0_24]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_24]
      at java.lang.Thread.run(Unknown Source) [:1.6.0_24]
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Exception while parsing ejb-jar.xml: /c:/jboss-as-7.1.0.Beta1/jboss-as-7.1.0.Beta1/bin/content/BtsSearch.ear/BtsSearchejb.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.Beta1.jar:]
      ... 5 more
      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2652,7]
      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(AbstractNamedMetaDataWithDescriptionGroupParser.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
      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
      {code}

       

      The ejb.jar contains the following section:

       

       

      {code}

          <message-driven>

            <description>Message Driven Bean</description>

            <display-name>boardMB</display-name>

            <ejb-name>boardMB</ejb-name>

            <ejb-class>btslogic.boardMBBean</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>

            <ejb-local-ref>

              <ejb-ref-name>ejb/local/BtsGW</ejb-ref-name>

              <ejb-ref-type>Session</ejb-ref-type>

              <local-home>btslogic.BtsGWLocalHome</local-home>

              <local>btslogic.BtsGWLocal</local>

              <ejb-link>BtsGW</ejb-link>

            </ejb-local-ref>

          </message-driven>

       

      {code}

       

      I am aware of the fact that I have to change the definitions of the queues and topics. The above error was the first I got.

      Please indicate what could be wrong in the ejb.jar file if anything.

      The application (ear file) is today running in production on JBoss 4.

       

      I am not quite sure if I have packaged this text in a correct manner. If not please bear over with me.

        • 1. Re: Unable to deploy EJB 2.1 including message-driven beans on JBoss AS 7.1.0 Beta
          Alexey Makhmutov Newbie

          The schema for EJB 2.1 doesn't have 'acknowledge-mode'  element for ejb-jar.xml (http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd). So, provided xml part is invalid if 2.1 version is specified for ejb-jar.xml.

          This particular setting is part of activation properties (see EJB spec 15.4.10). If you don't specify it, then 'Auto-acknowledge' is the default value. If you want to specify it explicitly, then the corresponding section for EJB 2.1 should be like something:

           

              <message-driven>

                <description>Message Driven Bean</description>

                <display-name>boardMB</display-name>

                <ejb-name>boardMB</ejb-name>

                <ejb-class>btslogic.boardMBBean</ejb-class>

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

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

                <activation-config>

                  <activation-config-property>

                    <activation-config-property-name>acknowledgeMode</activation-config-property-name>

                    <activation-config-property-value>Auto-acknowledge</activation-config-property-value>

                  </activation-config-property>

                </activation-config>

                <ejb-local-ref>

                  <ejb-ref-name>ejb/local/BtsGW</ejb-ref-name>

                  <ejb-ref-type>Session</ejb-ref-type>

                  <local-home>btslogic.BtsGWLocalHome</local-home>

                  <local>btslogic.BtsGWLocal</local>

                  <ejb-link>BtsGW</ejb-link>

                </ejb-local-ref>

              </message-driven>