File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes several ears, GF3, EJB 3 and JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "several ears, GF3, EJB 3 and JPA" Watch "several ears, GF3, EJB 3 and JPA" New topic

several ears, GF3, EJB 3 and JPA

Andrew Oswald

Joined: Nov 15, 2010
Posts: 1
Hi all!
As my project becomes larger and difficult to test, I decided to split my single good-working ear in several ears, some of them running as a standalone "service".
And stucked in cross-ear communication. Please help, what am I doing wrong?
I've simplified everything, only two ears left with no success, going mad

persistence.jar (JPA POJO classes, implementing interfaces from api.jar)
ejb.jar (stateless beans for accessing and managing of persistence units)
api.jar (cross-ear interfaces api, contains also remote interfaces for ejb.jar)

wars, other libraries and ejb's
api.jar (absolutely the same as in EAR1)

EAR1 deploys ok, all classes found and working (tested by scheduled beans inside that ear)
EAR2 deploys ok, JNDI names of EAR1's ejbs resolved, but when war in EAR2 tries to get list of certain serializable JPA instances via EJB remote call I finally get the following root cause:


EAR1, EAR2: api.jar

EAR2: EJB injection in war:

Application descriptors are simple, no GF specific descriptors provided
EAR1: api.jar and persistence.jar placed inside "library-directory"

EAR2: api.jar placed inside "library-directory"

All JPA objects implement interfaces from "api.jar" along with ""
Error disappears when I place persistence.jar into EAR2. Looks like EAR1 does not provide proper JPA object stubs or whatever needed by EAR2.
Am I missing something?
I agree. Here's the link:
subject: several ears, GF3, EJB 3 and JPA
It's not a secret anymore!