Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error with EJB relationship in JBoss-3.0.4

843829Apr 20 2003 — edited Apr 30 2003
Hello,

I am trying to deploy my test bean with JBoss-3.0.4 and it gives the following error with the relationship.


[ObjectName: jboss.j2ee:jndiName=Emp,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: Atleast one role of a foreign-key mapped relationship must have key fields: ejb-relation-name=EMP-DEPT, ObjectName: jboss.j2ee:jndiName=Dept,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: Atleast one role of a foreign-key mapped relationship must have key fields: ejb-relation-name=EMP-DEPT]


this is the way i defined the relation

<!-ejb-jar.xml ->

<relationships>
<ejb-relation>
<ejb-relation-name>EMP-DEPT</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>EMP-has-a-DEPT</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>Emp</ejb-name>
</relationship-role-source>
<cmr-field><cmr-field-name>DEPT_ID</cmr-field-name></cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>DEPT-has-EMP</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>Dept</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships>

<!-jbosscmp-jdbc.xml ->

<relationships>
<ejb-relation>
<ejb-relationship-name>EMP-DEPT</ejb-relationship-name>
<foreign-key-mapping />
<ejb-relationship-role>
<ejb-relationship-role-name>EMP-has-a-DEPT</ejb-relationship-role-name>
<key-fields />
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>DEPT-has-EMP</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>DEPT_ID</field-name>
<column-name>DEPT_ID</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
</ejb-relation>
</relationships>

to check further the source code is attached. every help will be appriciated as am knocking my head for some days on this.

thanks in advance

joan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2003
Added on Apr 20 2003
3 comments
105 views