3 Replies Latest reply on Sep 29, 2002 7:41 PM by Laureano Ruiz

    JBoss 3.0, problem with One-Many using CMP2.0, keys not allo

    DAVID Newbie

      Hi,
      i am trying to use a CMP2.0 mapping with JBoss 3.0, -version of 19-02-2002 - and when i try to define a 1:N relationship between two EJBs, and i deploy them the server says ...

      17:08:52,573 ERROR [EJBDeployer] Could not deploy file:/D:/jboss-3.0.0DR1/deploy
      /figuraEntityEJB.jar
      org.jboss.deployment.DeploymentException: Role: FiguraIdiomas with multiplicity
      many using foreign-key mapping is not allowed to have key-fields
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.
      loadKeyFields(JDBCRelationshipRoleMetaData.java:353)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.
      init(JDBCRelationshipRoleMetaData.java:157)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.(J
      DBCRelationMetaData.java:309)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:383)

      [....]

      my XML FILES are as follows,

      ************** ejb-jar.xml **************


      <ejb-relation>
      <ejb-relation-name>Figura-FiguraIdioma</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Figura-tiene-FiguraIdiomas</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>figuraEntityEJB</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>figuraIdiomas</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>

      <ejb-relationship-role>
      <ejb-relationship-role-name>FiguraIdiomas</ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>figuraIdiomaEntityEJB</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>


      ************** jbosscmp-jdbc.xml **************


      <ejb-relation>
      <ejb-relation-name>Figura-FiguraIdioma</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Figura-tiene-FiguraIdiomas</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>figuraEntityEJB</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>figuraIdiomas</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>

      <ejb-relationship-role>
      <ejb-relationship-role-name>FiguraIdiomas</ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>figuraIdiomaEntityEJB</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>



      any ideas????