Calls to ClassLoader.getSystemClassLoader that are beyond my control [message #84751] |
Thu, 22 March 2007 12:55 |
Eclipse User |
|
|
|
Originally posted by: william.weatherill.lhasalimited.org
Hi,
I'm fairly new to Equinox and OSGi in general. My question is regarding
classloading and is best explained with an example:
Suppose I write a bundle (called MyBundle) that relies on some 3rd party
code. I decide to wrap this 3rd party code in its own bundle (called
ExternalBundleA). This 3rd party code also relies on some other 3rd party
code which I also choose to bundle up (called ExternalBundleB).
What happens if some code in ExternalBundleA makes a call to
ClassLoader.getSystemClassLoader() and uses the resulting ClassLoader to
load a class that is from it's external dependency (which I put into
ExternalBundleB). Will I get a ClassNotFoundException?
I guess in a simple non-OSGi application all classes would be on the system
classpath and so the developers of the code that I've put into
ExternalBundleA were quite legitimate in their class loading strategy.
However by bundling up their code I am using it in a way that they never
intended.
Is this scenario possible? If so then does it suggest that it might not
always be possible to successfully bundle some 3rd party code?
Thank you in advance
Will
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03018 seconds