Bug 1057835

Summary: JBoss EAP6 is not able to parse ejb-jar.xml of version 2.0
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jay SenSharma <jsenshar>
Component: EJBAssignee: Ivo Studensky <istudens>
Status: CLOSED CURRENTRELEASE QA Contact: Jan Martiska <jmartisk>
Severity: urgent Docs Contact:
Priority: high    
Version: 6.2.0CC: ahoness, bmaxwell, cdewolf, dosoudil, istudens, jason.greene, jawilson, jdoyle, kkhan, lakagwu, myarboro, sjadhav, wfink
Target Milestone: DR13   
Target Release: EAP 6.4.0   
Hardware: All   
OS: All   
Whiteboard: block_CR
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-19 12:38:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1171105    
Bug Blocks:    

Description Jay SenSharma 2014-01-25 05:23:22 UTC
Description of problem:
-----------------------
- While using "ejb-jar.xml" of version 2.0 as following the EAP6.2 throws the parsing error:

{code}
<?xml version="1.0"?>
<!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>
      <message-driven>
         <ejb-name>ExampleMDB</ejb-name>
         <ejb-class>test.mdb.ExampleMDB</ejb-class>
         <transaction-type>Container</transaction-type>
         <message-driven-destination>
            <destination-type>javax.jms.Queue</destination-type>
         </message-driven-destination>
         <resource-ref>
            <res-ref-name>jms/QueueConnectionFactory</res-ref-name>
            <res-type>javax.jms.QueueConnectionFactory</res-type>
            <res-auth>Container</res-auth>
         </resource-ref>
      </message-driven>
   </enterprise-beans>
</ejb-jar>
{code}


- The following error is encountered at the time of deployment:

{code}
17:40:04,405 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."TestEJB.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."TestEJB.jar".PARSE: JBAS018733: Failed to process phase PARSE of deployment "TestEJB.jar"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014185: Exception while parsing ejb-jar.xml: /content/TestEJB.jar/META-INF/ejb-jar.xml
    at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.parseEjbJarXml(EjbJarParsingDeploymentUnitProcessor.java:250)
    at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.deploy(EjbJarParsingDeploymentUnitProcessor.java:121)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    ... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[14,10]
Message: Unexpected element 'message-driven-destination' encountered
    at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:109)
    at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElement(AbstractMetaDataParser.java:56)
    at org.jboss.metadata.ejb.parser.spec.AbstractNamedMetaDataWithDescriptionGroupParser.processElement(AbstractNamedMetaDataWithDescriptionGroupParser.java:67)
    at org.jboss.metadata.ejb.parser.spec.AbstractEnterpriseBeanMetaDataParser.processElement(AbstractEnterpriseBeanMetaDataParser.java:85)
    at org.jboss.metadata.ejb.parser.spec.AbstractMessageDrivenBeanParser.processElement(AbstractMessageDrivenBeanParser.java:94)
    at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.processElement(MessageDrivenBean31Parser.java:77)
    at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.processElement(MessageDrivenBean31Parser.java:37)
    at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:69)
    at org.jboss.metadata.ejb.parser.spec.MessageDrivenBean31Parser.parse(MessageDrivenBean31Parser.java:44)
    at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.processElement(EnterpriseBeansMetaDataParser.java:99)
    at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.processElement(EnterpriseBeansMetaDataParser.java:40)
    at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:69)
    at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.parse(EnterpriseBeansMetaDataParser.java:75)
    at org.jboss.metadata.ejb.parser.spec.EnterpriseBeansMetaDataParser.parse(EnterpriseBeansMetaDataParser.java:68)
    at org.jboss.metadata.ejb.parser.spec.AbstractEjbJarMetaDataParser.processElement(AbstractEjbJarMetaDataParser.java:112)
    at org.jboss.metadata.ejb.parser.spec.AbstractEjbJarMetaDataParser.processElement(AbstractEjbJarMetaDataParser.java:39)
    at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:69)
    at org.jboss.metadata.ejb.parser.spec.EjbJarMetaDataParser.parseDocument(EjbJarMetaDataParser.java:110)
    at org.jboss.metadata.ejb.parser.spec.EjbJarMetaDataParser.parse(EjbJarMetaDataParser.java:54)
    at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.parseEjbJarXml(EjbJarParsingDeploymentUnitProcessor.java:247)
    ... 7 more

17:40:04,422 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "TestEJB.jar" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"TestEJB.jar\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"TestEJB.jar\".PARSE: JBAS018733: Failed to process phase PARSE of deployment \"TestEJB.jar\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014185: Exception while parsing ejb-jar.xml: /content/TestEJB.jar/META-INF/ejb-jar.xml
    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[14,10]
Message: Unexpected element 'message-driven-destination' encountered"}}
{code}


**NOTE:** According to the link [1] EJB2.0 is supported with EAP6 so ideally JBoss should be able to parse the "ejb-jar.xml" of version 2.0 DTDs.

**NOTE:** there is a feature request seen for JBossAS7 for requesting support for ejb-jar.xml 2.0 DTDs  [2]

[1] https://access.redhat.com/site/articles/113373
[2] https://issues.jboss.org/browse/JBMETA-354



Version-Release number of selected component (if applicable):
How reproducible:

Steps to Reproduce:
1. Deploy an MDB based EJB jar in EAP6 and use the ejb-jar.xml as mentioned in the issue description.


Actual results:
- EAP6 should be able to parse the ejb-jar.xml properly and should deploy the MDB properly.


Expected results:
- Deployment should be successful.


Additional info:

Comment 1 wfink 2014-06-27 18:19:19 UTC
This is against the JavaEE specification
JSR220(ejb3.0) and JSR318(ejb3.1)
 chapter 19.Deployment Desriptor
         19.4. Container Providers Responsibility

""
All EJB 3.0 implementations must support EJB 2.1, EJB 2.0, and EJB 1.1 as well as EJB 3.0 deploy-
ment descriptors. The definitions of the EJB 2.1, EJB 2.0, and EJB 1.1 deployment descriptors can be
found in the Enterprise JavaBeans 2.1 specification [3].
""

Comment 5 Jason T. Greene 2014-11-20 16:16:51 UTC
We believe we can do this fix in a CP and that it should not block the release.

Comment 11 Ivo Studensky 2014-12-04 14:25:27 UTC
PR: https://github.com/jbossas/jboss-eap/pull/2117

Comment 12 JBoss JIRA Server 2014-12-05 09:42:38 UTC
Ivo Studensky <istudens> updated the status of jira JBMETA-354 to Resolved

Comment 14 Jan Martiska 2014-12-12 12:02:25 UTC
Verified in EAP 6.4.0.DR13.