0 Replies Latest reply on Feb 21, 2006 7:34 AM by Tapani

    Found in jboss.xml but not in ejb-jar.xml

    Tapani Newbie

      Is there a bug in jBoss or why is it giving this error? As anybody can see the bean is defnied with exactly the same name on both xml descriptors.

      -Tapani

      12:22:28,250 ERROR [XmlFileLoader] failed to load jboss.xml. There could be a syntax error.
      org.jboss.deployment.DeploymentException: Error in jboss.xml for Bean MySessionBean: found in jboss.xml but not in ejb-jar.xml
       at org.jboss.metadata.ApplicationMetaData.importJbossXml(ApplicationMetaData.java:915)
       at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:185)
       at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:506)
      ...


      EJB-JAR.XML

      <?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>MySessionBean</ejb-name>
       <local-home>com.foo.server.MySessionLocalHome</local-home>
       <local>com.foo.server.MySessionLocal</local>
       <ejb-class>com.foo.server.MySessionBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       <resource-ref>
       <res-ref-name>jdbc/myDataSource</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       </resource-ref>
       </session>
       </enterprise-beans>
       <assembly-descriptor>
       <container-transaction>
       <method>
       <ejb-name>MySessionBean</ejb-name>
       <method-intf>Local</method-intf>
       <method-name>*</method-name>
       </method>
       <trans-attribute>NotSupported</trans-attribute>
       </container-transaction>
       </assembly-descriptor>
      </ejb-jar>


      JBOSS.XML

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 4.0//EN"
       "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
      <jboss>
       <enterprise-beans>
       <session>
       <ejb-name>MySessionBean</ejb-name>
       <resource-ref>
       <res-ref-name>jdbc/myDataSource</res-ref-name>
       <jndi-name>java:/MyDB</jndi-name>
       </resource-ref>
       </session>
       </enterprise-beans>
      </jboss>