Little Help with CMP Entity Bean

I have the following error:

MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM

ObjectName: jboss.j2ee:service=EjbModule,module=SISEPROEJB.jar

State: FAILED

Reason: org.jboss.deployment.DeploymentException: Atleast one role of a

foreign-key mapped relationship must have key fields (or <primkey-field> is

missing from ejb-jar.xml): ejb-relation-name=Abogado-to-Admninistrativo

I have two entity beans called abogado and adminsitrativo, the relation is abogado-has-many-adminitrativo, (one-to-many)

Here is my xdoclet code in abogado:

/**

* @ejb.interface-method

* @ejb.relation

*name="Abogado-to-Administrativo"

*role-name="Abogado-has-many-Administrativo"

*target-ejb = "Administrativo"

*target-role-name = "Administrativo-has-one-Abogado"

* @jboss.target-relation related-pk-field = "userName"

*fk-column = "UserName_id_fk"

* @return Collection de procesos administrativos

*/

publicabstract Collection getProcesos();

Here is the xdoclet code for administrativo

/**

* @ejb.interface-method

*

* @ejb.relation name="Abogado-to-Admninistrativo"

*role-name="Administrativo-has-one-Abogado"

*target-ejb="Abogado"

*target-role-name="Abogado-has-many-Administrativo"

*target-multiple="true"

*

* @return

*/

publicabstract AbogadoLocal getAbogado();

Both beans have pk fields defined with:

* @ejb.persistence column-name ="id"

* @ejb.pk-field

and

* @ejb.interface-method

* @ejb.persistence column-name ="UserName"

*sql-type="VARCHAR"

* @ejb.pk-field

Please help me I have been stuck here for the whole weekend.

Thanks

Daniel Castro

[2093 byte] By [dani-casa] at [2007-10-3 10:21:31]
# 1
Try the following forum (about EJB technology) http://forum.java.sun.com/forum.jspa?forumID=13
UncleSAMa at 2007-7-15 5:43:02 > top of Java-index,Desktop,Developing for the Desktop...