dev@glassfish.java.net

Re: [Fwd: Package.getImplementationVersion method in OSGi bundle]

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Thu, 21 Aug 2008 14:35:55 -0700

I didn't see an answer to this...

Can we make the build process create manifest files that have both
the OSGi version information *and* the version information used by
java.lang.Package? Please?

I believe Sahoo was going to specify the mapping between the
different headers involved.


Ken Paulsen wrote:
>
> Forwarding to the dev alias as others may know or be interested in
> knowing the answer to this question....
>
> Ken
>
> ------------------------------------------------------------------------
>
> Subject:
> Package.getImplementationVersion method in OSGi bundle
> From:
> Tom Mueller <Tom.Mueller_at_Sun.COM>
> Date:
> Thu, 14 Aug 2008 14:18:59 -0500
> To:
> Sahoo <sahoo_at_sun.com>
>
> To:
> Sahoo <sahoo_at_sun.com>
> CC:
> Anissa Lam <Anissa.Lam_at_Sun.COM>, Ken Paulsen <Ken.Paulsen_at_sun.com>
>
>
> Sahoo,
>
> I'm not sure if you are the right person to ask this, but here goes.
>
> I'm using the Package.getImplementationVersion method to get the version
> information out of a JAR file for use in a User-Agent value. This works
> fine when in a standalone Java process, but when the JAR file is used as
> an OSGi bundle, I'm getting an empty string return value.
>
> Previously, I was calling Class.getProtectionDomain().getCodeSource() in
> order to get access to the JAR file itself to read the manifest
> directly, and getCodeSource was returning null when the JAR file is an
> OSGi module.
>
> Are these known problems with the OSGi implementation in GFv3? Should
> these methods be expected to work when a JAR file is used as an OSGi
> bundle?
>
> Thanks.
> Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net