You can have your entities in different jars, no problem.
Do you have the beans defined in different deployment descriptors?
You can't have separate dds . Both beans have to be defined in the same dd if you have a cmr
relationship between them.
Thanks, I've put all the entities in only one jar with only one deployment descriptor and it's working fine.
Is the constraint "both beans have to be defined in the same dd if you have a cmr relationship between them" defined in the spec (I haven't found anything) or is this a JBoss limitation ?
It is perfectly defined in the spec and the descriptor schema:
<xsd:complexType name="ejb-nameType"> <xsd:annotation> <xsd:documentation> The ejb-nameType specifies an enterprise beanÃ‚Â’s name. It is used by ejb-name elements. This name is assigned by the ejb-jar file producer to name the enterprise bean in the ejb-jar fileÃ‚Â’s deployment descriptor. The name must be unique among the names of the enterprise beans in the same ejb-jar file.There is no architected relationship between the used ejb-name in the deployment descriptor and the JNDI name that the Deployer will assign to the enterprise beanÃ‚Â’s home. The name for an entity bean must conform to the lexical rules for an NMTOKEN. Example: <ejb-name>EmployeeService</ejb-name> </xsd:documentation> </xsd:annotation>
For the ejb-name, you can use a path name relative to the referencing ejb-jar file. Appends the ejb-name of the referenced bean to the path name separated by #.