users@glassfish.java.net

persistence.xml in multiple EJB module EAR

From: <glassfish_at_javadesktop.org>
Date: Tue, 08 Apr 2008 07:44:16 PDT

Hey guys,

I'm having significant problems with glassfish correctly deploying my EAR. It consists of multiple EJB modules, all having their own entities but some entities from one ejb module inherit from entities in another. My question now is, where am I supposed to put which persistence.xml? I've tried giving each ejb module it's own persistence.xml, this fails with glassfish claiming it cant find the relevant class (so it knows which entity class to examine somehow, but fails to find the same class it needed to make this determination).

In short, given this scenario and the following application.xml (removed some clutter), how and where do i define the persistence.xml in the ear, in which jar or which directory of the EAR :

<application>
  <display-name>project-ear</display-name>
  <module>
    <ejb>base.jar</ejb>
  </module>
  <module>
    <ejb>extension.jar</ejb>
  </module>
</application>
[Message sent by forum member 'remonvv' (remonvv)]

http://forums.java.net/jive/thread.jspa?messageID=268173