Mark Crompton

Greenhorn
+ Follow
since Jan 19, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Crompton

Hi Cameron,

In theory I'd like to run the application across two application servers. One running the business logic (session beans & JPA entity beans), and the other running the web UI (JSF). The web part would request data from the business part via the session beans, the sessions beans returning the JPA entities back to the web UI as POJOs. Both the business and web parts are using Geronimo 2.1.

I've registered the data source in the business logic app server, which is the only part that should access the database. I understand that the JPA entities should be detached from the persistance manager when they are serialized over to the web UI. So the web UI server should not need the data source to be registered.

I think my problem is the way I've got the JPA entities packaged. They were created in an Eclipse WTP2 JPA project, so have the entities and the persistance deployment descriptors packaged together in a single jar file. I've then included this jar file in both an ear file, which gets deployed to the business logic app server, and a war file, which gets deployed to the web UI app server. When I try and deploy the war it gets rejected because of the lack of a data source on the web UI app server.

I hope that makes my setup a bit clearer. Sorry it's such a long-winded explanation.

Cheers,
Mark

Hi,

I'm just starting out on the road to learning JavaEE5 and JPA. I've created a set of JPA entities (all in Eclipse 3.4 using the WTP's various JPA & JavaEE projects) and added them to an EAR file. Access to the JPA entities is via a set of session beans, packaged in an EJB jar and added to the same EAR. The EAR is then deployed to Apache Geronimo 2.1.

I'd then like to run the web UI from a WAR file running on another app server. The WAR includes the JPA entity jar so the entity beans can be used as DTOs via the session beans. However, when the WAR file is deployed, the web server (Geronimo 2.1 again) complains that the data source for the JPA entities is not defined. Which is reasonable as its part of the persistance.xml in the entities' jar file.

My question is: what's the best way of packaging the JPA entities so they can be used as JPA entities by the main app server, and as simple POJO DTOs by the web server? I'm guessing it involves separating persistance.xml from the entity beans. But that seems to put an end to using the nice JPA features in Eclipse.

Any suggestions would be gratefully received.

Many thanks,
Mark