Bug 379253 - Problem updating a bundle
Summary: Problem updating a bundle
Status: RESOLVED WORKSFORME
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2012-05-11 09:52 EDT by Templier Thierry CLA
Modified: 2014-02-21 17:10 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Templier Thierry CLA 2012-05-11 09:52:25 EDT
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
Comment 1 Thomas Watson CLA 2012-05-14 09:29:12 EDT
It would help if you could attach some test bundles that exhibit the behavior and help us to reproduce.
Comment 2 Thomas Watson CLA 2014-02-21 17:10:57 EST
We need a testcase to reproduce.