users@glassfish.java.net

Re: WAR using extenal JARs

From: <glassfish_at_javadesktop.org>
Date: Tue, 05 Oct 2010 08:18:22 PDT

OSGi might be the solution to your problem.

When using OSGi, all your JARs (including the WARs) are skinny JARs *not* containing any other JARs. Instead they declare dependencies on other JARs. Thus, your web service JARs would declare dependencies on the JARs that you currently have in your GlassFish's lib directory. And you can use GlassFish's deployment functionality for OSGi bundles.

However, all your JARs need to be OSGi bundles for this purpose (i.e. simply add a MANIFEST.MF with OSGi meta data).

Note, that you might run into some other problems, though, because (1) OSGi has very strict class-loading policies (in order to ensure clean dependencies) and (2) there was a bug in GF concering OSGi - not sure if it is fixed.

I recommend, you first evaluate it a bit before starting to migrate your whole app to the new deployment.

Anyway, the legacy EAR deployment has many disadvantages and OSGi rocks!!!

See this for further infos: http://forums.java.net/jive/thread.jspa?threadID=79976

I hope, I could help!

Best regards, Marco :-)
[Message sent by forum member 'nlmarco']

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