dev@glassfish.java.net

Re: broken Felix classloader?

From: Ludovic Champenois <Ludovic.Champenois_at_Sun.COM>
Date: Thu, 23 Apr 2009 15:56:38 -0700

On 4/23/09 3:43 PM, Lloyd Chambers wrote:
> Richard,
>
> I found that I was mistaken about module amx-config. It had no
> reference to javax.management, so it had no Import-Package directive
> for it.
>
> That OSGi prevents access to standard JDK classes defies common sense
> IMO, but that's the last I'll gripe about it.
>
> ...
>
> The simplest solution I found was to add a dummy interface in the module:
>
> public interface ForceThisModuleToHaveAccesstoTheseTypes
> {
> public javax.management.ObjectName
> forceInclusionOf_javax_management();
> }
>
> Adding this class causes Import-Package to include javax.management.
>
> Lloyd
>
Great to see the solution...
We might need to start investing more time in OSGi debug tooling, for
example this visualizer tool
http://eclipsesource.com/blogs/2009/04/13/visualizing-osgi-systems/
Not sure it covers javax.* packages, but that would be a good
requirement to add.
Ludo