2 Replies Latest reply on Sep 8, 2003 5:49 AM by smehta

    Info on ..."Error in ejb-jar.xml ...expected one home tag"

    smehta Newbie

      Hello all

      I am trying to upgrade from JBoss 2.2 to 3.21 and am trying to deploy an entity bean.

      To speed up performance, I have changed our EJBs to use local-home and local.

      Here is an excerpt of my ejb-jar.xml

      ..........................................................

      <!-- Attribute -->


      Attribute Desc.


      <ejb-name>AttributeBean</ejb-name>
      <local-home>test.ejb.AttributeHome</local-home>
      test.ejb.Attribute
      <ejb-class>test.ejb.AttributeBean</ejb-class>

      <persistence-type>Bean</persistence-type>
      <prim-key-class>test.ejb.AttributePK</prim-key-class>

      False

      <ejb-ref>
      <ejb-ref-name>ejb/RelationToAttrBean</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>RelationToAttrHome</local-home>
      RelationToAttr
      <ejb-link>RelationToAttrBean</ejb-link>
      </ejb-ref>

      <resource-ref>
      DataSource for myTest
      <res-ref-name>jdbc/myTest</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>



      <!-- RelationToAttr -->


      Relationship between attributes.


      <ejb-name>RelationToAttrBean</ejb-name>
      <local-home>test.ejb.RelationToAttrHome</local-home>
      test.ejb.RelationToAttr
      <ejb-class>test.ejb.RelationToAttrBean</ejb-class>

      <persistence-type>Bean</persistence-type>
      <prim-key-class>test.ejb.RelationToAttrPK</prim-key-class>

      False

      <resource-ref>
      DataSource for myTest
      <res-ref-name>jdbc/myTest</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/AttributeBean</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      AttributeHome
      Attribute
      <ejb-link>AttributeBean</ejb-link>
      </ejb-ref>



      <!-- Permissions -->

      <method-permission>
      <role-name>everyone</role-name>

      <ejb-name>AttributeBean</ejb-name>
      <method-name>*</method-name>

      </method-permission>


      <container-transaction>

      <ejb-name>AttributeBean</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      ..................................................................

      When I deploy this Bean, I get the following error:

      13:00:55,525 ERROR [MainDeployer] could not create deployment: file:/D:/UpGradeJBoss/Final/32/TestArea3.2/server/default
      /deploy/MyTestBeans.jar
      org.jboss.deployment.DeploymentException: Error in ejb-jar.xml for Entity Bean AttributeBean: expected one home tag
      at org.jboss.metadata.ApplicationMetaData.importEjbJarXml(ApplicationMetaData.java:252)
      at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:141)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:433)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)

      Would appreciate any help on the matter.

      Thx

      smehta