2 Replies Latest reply on May 29, 2012 11:15 AM by Oleg Nitz

    error deploying EJB2.1 in JBoss 7.1.1 (JMS)

    pep grifell Newbie

      hi,

       

      in my ejb-jar I declare a session with a reference to a queue

       

      <session>

      ...

       

        <message-destination-ref id="MessageDestinationRef_1295446106575">
                  <message-destination-ref-name>jms/HomeTAOEventsQueue</message-destination-ref-name>
                  <message-destination-type>javax.jms.Queue</message-destination-type>
                  <message-destination-usage>Produces</message-destination-usage>
                  <message-destination-link>QUEUE.HOMETAO_EVENTS</message-destination-link>
         </message-destination-ref>
        ...
      </session>
      

       

      at the end of the file:

       

      <assembly-descriptor>  
      ...
         <message-destination>
                           <message-destination-name>QUEUE.HOMETAO_EVENTS</message-destination-name>
          </message-destination>
      </assembly-descriptor>
      

       

      When I deploy my ear I get this error:

       

      Exception while parsing ejb-jar.xml: /C:/.../ejb-jar.xml
      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2648,3]
      Message: Unexpected element '{http://java.sun.com/xml/ns/j2ee}message-destination' encountered
      

       

      If I try to validate the XML against the Schema included at the top (http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd), the XML is validated correctly.

       

      Any idea about this eror ?

      Thanks.

        • 1. Re: error deploying EJB2.1 in JBoss 7.1.1 (JMS)
          Tomaz Cerar Master

          Hi,

           

          what happens if you update xsd schema to 3.1

          so xsd header would look like this:

           

          <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"

                   version="3.1">

          if it does not help, can you post the stacktrace of parsing error that occures as from code & tests i see that we are functionality of "message-destination"...

           

          --

          tomaz

          • 2. Re: error deploying EJB2.1 in JBoss 7.1.1 (JMS)
            Oleg Nitz Newbie

            Hi,

             

            I have the same problem. Looks like JBoss 7.1.1 just doesn't support "message-destination" in ejb-jar.xml for EJB 2.1

            The stack trace follows:

             

            Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[66,9]

            Message: Unexpected element '{http://java.sun.com/xml/ns/j2ee}message-destination' 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.AssemblyDescriptorMetaDataParser.processElement(AssemblyDescriptorMetaDataParser.java:112)

                      at org.jboss.metadata.ejb.parser.spec.AssemblyDescriptorMetaDataParser.processElement(AssemblyDescriptorMetaDataParser.java:41)

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

                      at org.jboss.metadata.ejb.parser.spec.AssemblyDescriptorMetaDataParser.parse(AssemblyDescriptorMetaDataParser.java:51)

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

                      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:245)

             

            Switching to EJB 3.1 seems to wok, but it changes JNDI name of the bean, now need to change client code...