The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

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