1 Reply Latest reply on Apr 24, 2014 9:34 AM by jaikiran pai

    Jboss-ejb3.xml : cannot be parsed at all...

    David Sporn Newbie

      Product info :

      JBoss Modules version 1.2.0.Final-redhat-1

      JBoss MSC version 1.0.4.GA-redhat-1

      JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8)

       

      Problem description :

      ( Context : Migrating a project from Jboss 4.2.x to JBoss EAP 6.1. The project contains a MDB beans. For corporate reasons, the production server is websphere and the development workstation use jboss, thus every ressources references MUST be mapped to a real JNDI name using a binding descriptor, that was jboss.xml. Now it seems I have to use create a jboss-ejb3.xml. )

       

      Steps to reproduce : I started with the sample found here jboss-ejb3.xml Reference - JBoss AS 7.1 - Project Documentation Editor

       

      <?xml version="1.1" encoding="UTF-8"?>
      <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
                     xmlns="http://java.sun.com/xml/ns/javaee"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns:c="urn:clustering:1.0"
                     xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
                     version="3.1"
                     impl-version="2.0">
          <enterprise-beans>
              <message-driven>
                  <ejb-name>OncMdb</ejb-name>
                  <activation-config>
                      <activation-config-property>
                          <activation-config-property-name>destination</activation-config-property-name>
                          <activation-config-property-value>java:/jms/B2AQuestionONC</activation-config-property-value>
                      </activation-config-property>
                  </activation-config>
                  <configuration-name>WSMQ Message Driven Bean</configuration-name>
                  <resource-ref>
                      <res-ref-name>jms/aixQCF</res-ref-name>
                      <jndi-name>java:/jms/aixQCF</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jdbc/onradmin</res-ref-name>
                      <jndi-name>java:/jdbc/onradmin</jndi-name>
                  </resource-ref>
      
                  <resource-ref>
                      <res-ref-name>jms/B2AQuestionONC</res-ref-name>
                      <jndi-name>java:/jms/B2AQuestionONC</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jms/B2AReponseONC</res-ref-name>
                      <jndi-name>java:/jms/B2AReponseONC</jndi-name>
                  </resource-ref>
                  <message-destination-ref>
                      <message-destination-ref-name>jms/B2AQuestionONC</message-destination-ref-name>
                      <jndi-name>java:/jms/B2AQuestionONC</jndi-name>
                  </message-destination-ref>
              </message-driven>
              <message-driven>
                  <ejb-name>OntMdb</ejb-name>
                  <activation-config>
                      <activation-config-property>
                          <activation-config-property-name>destination</activation-config-property-name>
                          <activation-config-property-value>java:/jms/B2AQuestionONT</activation-config-property-value>
                      </activation-config-property>
                  </activation-config>
                  <configuration-name>WSMQ Message Driven Bean</configuration-name>
                  <resource-ref>
                      <res-ref-name>jms/aixQCF</res-ref-name>
                      <jndi-name>java:/jms/aixQCF</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jdbc/onradmin</res-ref-name>
                      <jndi-name>java:/jdbc/onradmin</jndi-name>
                  </resource-ref>
      
                  <resource-ref>
                      <res-ref-name>jms/B2AQuestionONT</res-ref-name>
                      <jndi-name>java:/jms/B2AQuestionONT</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jms/B2AReponseONT</res-ref-name>
                      <jndi-name>java:/jms/B2AReponseONT</jndi-name>
                  </resource-ref>
              </message-driven>
          </enterprise-beans>
      </jboss:ejb-jar>
      
      

      I had troubles with all those namespace and xsd declarations :

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[18,4]
      Message: Unexpected element '{http://java.sun.com/xml/ns/javaee}configuration-name' 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)
      
      

       

      So I striped all of this, keeping only well-formed xml. As root tag, I tried "jboss", "ejb-jar", "jboss-ejb3" and "foo".

       

      <?xml version="1.1" encoding="UTF-8"?>
      <jboss-ejb3>
          <enterprise-beans>
              <message-driven>
                  <ejb-name>OncMdb</ejb-name>
                  <activation-config>
                      <activation-config-property>
                          <activation-config-property-name>destination</activation-config-property-name>
                          <activation-config-property-value>java:/jms/B2AQuestionONC</activation-config-property-value>
                      </activation-config-property>
                  </activation-config>
                  <configuration-name>WSMQ Message Driven Bean</configuration-name>
                  <resource-ref>
                      <res-ref-name>jms/aixQCF</res-ref-name>
                      <jndi-name>java:/jms/aixQCF</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jdbc/onradmin</res-ref-name>
                      <jndi-name>java:/jdbc/onradmin</jndi-name>
                  </resource-ref>
      
                  <resource-ref>
                      <res-ref-name>jms/B2AQuestionONC</res-ref-name>
                      <jndi-name>java:/jms/B2AQuestionONC</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jms/B2AReponseONC</res-ref-name>
                      <jndi-name>java:/jms/B2AReponseONC</jndi-name>
                  </resource-ref>
                  <message-destination-ref>
                      <message-destination-ref-name>jms/B2AQuestionONC</message-destination-ref-name>
                      <jndi-name>java:/jms/B2AQuestionONC</jndi-name>
                  </message-destination-ref>
              </message-driven>
              <message-driven>
                  <ejb-name>OntMdb</ejb-name>
                  <activation-config>
                      <activation-config-property>
                          <activation-config-property-name>destination</activation-config-property-name>
                          <activation-config-property-value>java:/jms/B2AQuestionONT</activation-config-property-value>
                      </activation-config-property>
                  </activation-config>
                  <configuration-name>WSMQ Message Driven Bean</configuration-name>
                  <resource-ref>
                      <res-ref-name>jms/aixQCF</res-ref-name>
                      <jndi-name>java:/jms/aixQCF</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jdbc/onradmin</res-ref-name>
                      <jndi-name>java:/jdbc/onradmin</jndi-name>
                  </resource-ref>
      
                  <resource-ref>
                      <res-ref-name>jms/B2AQuestionONT</res-ref-name>
                      <jndi-name>java:/jms/B2AQuestionONT</jndi-name>
                  </resource-ref>
                  <resource-ref>
                      <res-ref-name>jms/B2AReponseONT</res-ref-name>
                      <jndi-name>java:/jms/B2AReponseONT</jndi-name>
                  </resource-ref>
              </message-driven>
          </enterprise-beans>
      </jboss-ejb3>
      
      

       

      Whatever the root tag, I get this error message :

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,5]
      Message: Unexpected element 'enterprise-beans' encountered
          at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:109)
          at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.processElement(JBossEjb3MetaDataParser.java:173)
          at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.processElement(JBossEjb3MetaDataParser.java:41)
          at org.jboss.metadata.ejb.parser.spec.AbstractMetaDataParser.processElements(AbstractMetaDataParser.java:69)
          at org.jboss.metadata.ejb.parser.jboss.ejb3.JBossEjb3MetaDataParser.parse(JBossEjb3MetaDataParser.java:113)
          at org.jboss.as.ejb3.deployment.processors.EjbJarParsingDeploymentUnitProcessor.parseJBossEjb3Xml(EjbJarParsingDeploymentUnitProcessor.java:278)
          ... 7 more
      
      

       

      I don't know what to do now