dev@glassfish.java.net

Re: bundled asm 3.1 module (asm-all-repackaged.jar) manifest file broken?

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Wed, 08 Oct 2008 09:58:23 +0200

On Wed, Oct 08, 2008 at 08:08:38AM +0530, Sahoo wrote:
> That bundle is an implementation artifact and is not to be used by
> applications. Since applications can't always use the version of ASM
> that server requires, we have to hide the version that server requires.
> We do so by using those extra attributes. Only people who deploy OSGi
> bundles can use that bundle if they suitably specify the import headers
> in their bundles, but that does not apply to normal web app deployment.

I am in fact adding a Jersey based module
to GlassFish, so that users could deploy Jersey based apps without a need
to bundle additional jars into their wars.

So i believe there are two possible ways how to resolve the asm-3.1 dependency
for Jersey module here:

1. Jersey module would use the required GlassFish specific attributes
   in the ImportPackages header for the asm related packages

2. I would provide an OSGified asm 3.1 module and put it into GlassFish modules.
   It shouldn't create any conflict with your privately updated [asm-all-repackaged.jar]
   module, as you use a GlassFish specific attributes in it's OSGi headers

Is my assumptions correct?

Thanks,

~Jakub

> Since your Jersy based app needs ASM, you should do *one* of the following:
>
> 1. Copy appropriate version of asm.jar to domain1/lib and restart server.
> 2. Copy appropriate version of asm.jar to domain1/lib/applib/asm.jar.
> Then asadmin deploy <your app> --libraries asm.jar.
> 3. Bundle appropriate version of asm.jar in your application.
>
> HTH,
>
> Sahoo
>
> Jakub Podlesak wrote:
> >Hi all,
> >
> >I have tried to deploy a Jersey based web application onto GFv3 Prelude
> >b28.
> >As Jersey depends on asm-3.1.jar i have hoped it would work fine
> >with the GFv3 provided [asm-all-repackaged.jar]. But it does not.
> >
> >The corresponding manifest contains:
> >
> >Export-Package: org.objectweb.asm.tree.analysis;password=GlassFish;man
> > datory:=password;uses:="org.objectweb.asm.tree,org.objectweb.asm";ver
> > sion="3.1",org.objectweb.asm.commons;password=GlassFish;mandatory:=pa
> > ssword;uses:="org.objectweb.asm.tree,org.objectweb.asm.signature,org.
> > objectweb.asm";version="3.1",org.objectweb.asm.tree;password=GlassFis
> > h;mandatory:=password;uses:="org.objectweb.asm";version="3.1",org.obj
> > ectweb.asm.util;password=GlassFish;mandatory:=password;uses:="org.obj
> > ectweb.asm.tree.analysis,org.objectweb.asm.tree,org.objectweb.asm.sig
> > nature,org.objectweb.asm";version="3.1",org.objectweb.asm.signature;p
> > assword=GlassFish;mandatory:=password;version="3.1",org.objectweb.asm
> > .xml;password=GlassFish;mandatory:=password;uses:="org.xml.sax,org.ob
> > jectweb.asm.util,org.objectweb.asm,javax.xml.transform,javax.xml.tran
> > sform.sax,org.xml.sax.ext,org.xml.sax.helpers,javax.xml.transform.str
> > eam";version="3.1",org.objectweb.asm;password=GlassFish;mandatory:=pa
> > ssword;version="3.1"
> >
> >i am wondering what the additional [password=GlassFish] and
> >[mandatory=password] attributes mean there.
> >
> >When i put additional [asm.jar] into my GlassFish installation and omit
> >the two attributes in it's manifest, things start working for me.
> >(i am using java -jar bnd.jar wrap asm-3.1.jar to create the bundle)
> >
> >Would it be possible to re-bundle the asm.jar module, so that is does not
> >contain the two attributes?
> >
> >If not, what is the intended way of using the bundled
> >[asm-all-repackaged.jar]?
> >
> >Is there anybody successfully using it as a dependency for his module?
> >
> >Thanks in advance for your help,
> >
> >~Jakub
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>

-- 
http://blogs.sun.com/japod