[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Bundle context class loader in Component:activate/deactivate and Bundle:start/stop

I am running into an issue with bundle context class loader
1. I have some library code that dynamically loads classes using contextClassLoader or an explicitly set ClassLoader.
2. This code is triggered in  Component.activate() (I think same behaviour in Bundle.start() )
3. The classes I am loading are appropriately imported in bundle manifest and are visible in bundle loader

I get ClassNotFoundException. It seems like the current thread class loader is not set to the bundle class loader instead set to something else (ContextFinder or FrameworkClassLoader). I also tried bundle.getClass().getClassLoader() and it does not point to bundle loader either.

I have couple of questions on this:

1) Is the activate/deactivate (or start/stop) supposed to run in "bundle context loader". Have not seen any references in OSGI spec on this
2) Is there a standard API to get the Bundle ClassLoader to satisfy above need
3) Any other approach to addres the issue

Thanks,
-Ravi R