Accessing one module1 CMP2.0 entity from another module2 entity


EJB design: Accessing one module1 CMP2.0 entity from another module2 entity

  1. Hi,

    I have a problem with accessing one entity bean in another entity bean.
    I have some modules like user so user.jar will contain the user\ejb-jar.xml where the user entities info will be there in this jar.In the same way we had another module like clipboard so clipboard.jar will contain the clipboard\ejb-jar.xml which will contain the information of the clipboard entities.
    Now i have to form a Unidirectional One-One relationship(CMR) between UserAccount bean( that is there in the user bean) and ClipBoard bean( that is there in the clipboard component). Right now we are using only local home and local interfaces.
    I am deploying the application on JBOSS3.2.2. I tried so many options by putting the <ejb-local-ref> tag in ejb-jar.xml of user module. But i am getting the error that "SetClipboard is not a CMP,or CMR or ejbSelect method" error.

    Thanks in Advance,
  2. Hi!

    I think that CMR relationships are only allowed between EJBs from the same ejb-jar module.
  3. Alexey is right because if you want to use CMR (Container Manager Relationship),the relation must be defined in the same ejb-jar.xml file where the two entities in relation are defined.
  4. Hi,

     Thank you.
      As you said we can define CMR between EJBs that are defined in the same ejb-jar file. So even the EJB's are packed in different packages we defined the EJB's in the same ejb-jar.xml and it is working fine.