Overall Search Order1. java.*, delegates to parent, if parent can not ﬁnd it, fails2. if in boot delegation list, delegates to parent3. if import, delegates to exporting bundle class loader, if not found, fails4. if Required-Bundle, delegates to the required bundles’ class loaders, depth-ﬁrst5. Bundle-Classpath6. fragments7. if DynamicImport-Package, delegates to exporting bundle class loader8. equinox will try to apply buddy policy
ClassNotFoundException• if deﬁned in Import-Package/Required-Bundle/DynamicImport- Package - where is the bundle exporting it - if no such a bundle exporting it, should we consider o.o.f.system.packages.extra• if loading dynamically using for example Class.forName() - make sure what is the class loader used to load this class - thread context class loader - bundle class loader - have we deﬁned in o.o.f.bootdelegation - what is the type of o.o.f.bundle.parent: boot, app, ext, or framework
References• of course OSGi speciﬁcation• http://codescale.wordpress.com/2009/05/22/ basics-about-osgi-classloading/• http://www.jfokus.se/jfokus09/slides/salong4/ OSGiClassloading.pdf• org.eclipse.osgi.internal.loader.BundleLoader in equinox does most of the tricks• someone helps me ﬁnd equivalent in felix?