I am currently working on making some very OSGi-unfriendly 3rd-party libraries available to our OSGi-bundles. One of these libraries (which I have already turned into a bundle using bnd) manages to load classes that it should not be able to load (at least by OSGi-rules). Lets assume that bundle is called Foo
, and the package from which it loads classes is called bar
.
Foo
has bar
as optional import. This shouldn't matter though, since there is no bundle that exports bar
. I am not using any boot-delegation. The jar
-file that contains bar
is on the application-classpath though (the OSGi-framework runs embedded in my application).
Apparently Foo
somehow bypasses the OSGi-classloading infrastructure. How can this be done? I am pretty sure that it does not use a custom class-loader, because there is just no reason for it to have one (no feature Foo
offers would require such a thing). So, what standard, out-of-the-box methods could be used by a bundle to bypass OSGi-classloading?