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

I saw a reference to "BundleProxyClassLoader" at http://wiki.eclipse.org/index.php/BundleProxyClassLoader_recipe. Setting delegate class loader as the current thread context loader solves the issue. Curious on OSGI bundle context loader settings on activate/deactivate (or start/stop) methods though

Thanks,
-Ravi R

----- Original Message ----
From: Ravindar Reddy <rroopreddy@xxxxxxxxx>
To: Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
Sent: Thursday, July 6, 2006 11:13:24 AM
Subject: [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


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev