dev@glassfish.java.net

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

From: Sahoo <Sahoo_at_Sun.COM>
Date: Wed, 08 Oct 2008 08:08:38 +0530

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.
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
>
>