users@glassfish.java.net

deploy ear in GFv3

From: <glassfish_at_javadesktop.org>
Date: Wed, 12 Aug 2009 04:18:14 PDT

I am a bit confused with how deployment of an ear is handled by GFv3(b58).
I have a project Foo with foo-ejb.jar and foo.war. Inside foo-ejb.jar, a persistence unit is declared (in persistence.xml) and used. Inside the war, jndi lookups are performed for calling methods on the stateless session beans in the foo-ejb.jar.
Deploying this ear in Netbeans works fine. Deploying it with asadmin deploy Foo.ear however gives an error:
Could not resolve a persistence unit corresponding to the persistence-context-ref-name [someFoo/em] in the scope of the module called [Foo/foo.war].

I tried to use the REST api for deploying the app:
curl "http://localhost:4848/__asadmin/deploy?path=/to/Foo/gfdeploy&name=Foo&force=true"
and that worked.
However, the gfdeploy directory created by NetBeans contains the unpacked jar director (foo-ejb_jar) containing the classes. It does not contain foo-ejb.jar as a jarfile itself, and this causes other problems (see see http://forums.java.net/jive/thread.jspa?messageID=359309).
When I added foo-ejb.jar to the gfdeploy directory, and redeployed with curl, I got the error message about the missing persistence unit in the WAR. Weird, I don't see a connection between these two.

I could bypass the exception reported in http://forums.java.net/jive/thread.jspa?messageID=359309 by hacking the jsp-impl.jar, so I'm ok. But still, I am curious about the background of these deployment issues.

- Johan
[Message sent by forum member 'johanvos' (johanvos)]

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