Community
Participate
Working Groups
Build Identifier: 20110218-0911 I installed a bundle programmatically using BundleContext.installBundle method. I put something like that for the bundle name (second parameter): file://[...]/[bundleName]-[bundleVersion].jar When I try then to update this bundle, it seems not to be correctly updated and I have then a NoClassDefFoundError exception when trying to use an OSGi service provided by the bundle: java.lang.NoClassDefFoundError: org/test/app/model/Test at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2444) at java.lang.Class.getDeclaredMethods(Class.java:1808) [...] Caused by: java.lang.ClassNotFoundException: org.test.app.model.Test at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) ... 51 more I put a trace in the getZipFile method of the SecureAction and Equinox tries to load the following file. It correspond to the updated bundle. [...]/workspaces/.metadata/.plugins/org.eclipse.pde.core/New_configuration/org.eclipse.osgi/bundles/155/13/bundlefile Reproducible: Sometimes Steps to Reproduce: 1. Install a bundle with BundleContext.installBundle method 2. Update the bundle with Bundle.update(InputStream) method 3. Call an OSGi service provided by the bundle
It would help if you could attach some test bundles that exhibit the behavior and help us to reproduce.
We need a testcase to reproduce.