users@glassfish.java.net

v3: problem deploying exploded ear with exploded shared entity lib

From: <glassfish_at_javadesktop.org>
Date: Sat, 27 Feb 2010 12:20:04 PST

I'm having trouble deploying an exploded ear archive to Glassfish v3 Final. The problem originally showed up when I was trying to deploy using Eclipse.

To simplify and troubleshoot I built the following simple example:

[b]Example Project[/b]
1. EJB jar that includes one EJB that injects the PersistenceUnit and tries to do work on it on startup.
2. Entity Jar that includes one entity type: EntityExample as well as a persistence.xml looking for the "jdbc/cat"
3. Ear that contains both of these jars (with the entity jar in the lib directory).

[b]Outcomes upon various deployment scenarios[/b]
1. Unexploded ear: successful deployment ([b]expected[/b])
2. Exploded ear with exploded ejb1.jar: successful deployment ([b]expected[/b])
3. Exploded ear with exploded ejb1.jar and exploded ent1.jar: throws IllegalStateException: Unable to retrieve EntityManagerFactory ([b]unexpected[/b])
4. Exploded ear with exploded ejb1.jar and missing ent1.jar: throws NoClassDefFoundError for ExampleEntity ([b]expected[/b])

Because 3 doesn't throw a no class found exception, the entity jar is in the classpath. Nonetheless, the persistence unit isn't available. All of my examples include a very basic application.xml but I don't believe any of the behavior changes without it.

I've attached all my examples to this post. (example.ear, exploded_partial, exploded_complete, exploded_invalid, eclipse project files).

What am I missing?

Thanks,
Jacques
[Message sent by forum member 'whshub' (whshub_at_gmail.com)]

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