tmpsa (16) [Avatar] Offline
#1
Another suggestion for an upcoming edition:

The Esotheric Art Of Ear Packaging could need more attention. A brief collected section with the basics would be nice; preferably graphic.

I just recently upgraded from Glassfish 2 to 3, and had a hellish time figuring out why my EAR suddenly didn't deploy properly. It turned out that GF2 is forgiving on some points, but GF3 sticks more to the specs (and rightly so).

+ I have my entities in a separate JAR, not in my EJB-JAR. That's okay, but it must be placed in the EAR:s magical /lib directory, not in / .

+ persistence.xml must be in the META-INF of the EJB-JAR, not of the entity JAR. Took me quite some time to figure out.

Cheers,
Per Lindberg
tmpsa (16) [Avatar] Offline
#2
Re: Packaging an EAR - where to put persistence.xml
Correction: it seems that entities must also be put in the EJB-JAR. (This subject is clearly non-trivial, and could stand some clarification).
reza_rahman (456) [Avatar] Offline
#3
Re: Packaging an EAR - where to put persistence.xml
Per,

Take a look at EJB 3.1/Java EE 6 simplified packaging smilie. This will get even better with JDK 7/Java EE 7 modularity...

Cheers,
Reza