dev@glassfish.java.net

Question on EAR packaging and deployment in V3

From: Rama Pulavarthi <Rama.Pulavarthi_at_oracle.com>
Date: Wed, 22 Dec 2010 23:38:22 -0800

Hi,
I have a question in regards to packaging the EAR and deployment in V3
for fixing a Web Services issue,
http://java.net/jira/browse/GLASSFISH-13548.

The test case (available in the above issue) has the following structure.
SampleService.ear
     META-INF/
     META-INF/MANIFEST.MF
     lib/
     META-INF/application.xml
     META-INF/sun-application.xml
     lib/SampleService-ejb.jar
     SampleService-ejb.jar
     SampleService-war.war
         META-INF/
         META-INF/MANIFEST.MF
             Class-Path: SampleService-ejb.jar
         WEB-INF/classes/...
         WEB-INF/web.xml

Problem: Web services in SampleService-ejb.jar are processed twice via
the ejb module and web module, and deployment fails due to this
duplication of web services stored in different bundle descriptors. The
same EAR seemed to deploy fine on V2.

I ran into this user's blog about problems in EAR deployment while
migrating from V2 to V3,
http://www.shareyourwork.org/roller/ralphsjavablog/entry/jee6_and_packaging_an_ear,
and am interested to know if the suggested methods in the blog are just
workaround for bugs in V3 or a prescribed way to deploy in EE 6?

Few questions around this issue and the blog
(1) The above blog mentions the jars under lib are by default shared by
all modules, Is this standard behavior even if not specified in
application.xml?

(2) I am also running in to resource injection problems as the blog
mentioned, Can ejbs be packaged and shared like this as in
SampleService.ear?

(3) Is there a way to detect this during deployment and avoid duplicate
web services?

thanks,
Rama Pulavarthi