Bug 185244 - bundle.update causes ClassCastException
Summary: bundle.update causes ClassCastException
Status: RESOLVED WORKSFORME
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2007-05-02 18:09 EDT by shean chang CLA
Modified: 2019-03-08 08:50 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 shean chang CLA 2007-05-02 18:09:01 EDT
start Equinox with config.ini and framework start level is set to 1
get all the installed bundles and update the one that has native code and bundle state has to be either installed or resolved
raise the framework start level to its proper value to start all the bundles

The test bundle which is accessing the updated bundle via OSGi service discovery failed due to ClassCastException

Without doing update then this problem is not occurring. 

The reason I am doing bundle update is because the bundle has native code and it is loaded via "reference" in the config.ini and I want the Equinox to reload the native code from the subsequent run.  If this is not the right way for that then 
maybe someone can point out the proper way.
Comment 1 Thomas Watson CLA 2007-05-08 11:37:29 EDT
- Does the bundle you update export the package which is used to publish a service?
- Do you get the ClassCastException when try to case the service object gotten from BundleContext.getService method?
- Have you tried running call PackageAdmin.refreshPackages on the updated bundle?  Does that help?

I'm a bit confused by the scenario.  Did you install a new version of the bundle with updated native code?  How did you do that, using OSGi API or by file replacement?  Are you restarting the VM or attempting to restart the framework without a VM restart and then running into issues loading the native library from the same path?  If that is the case this sounds like bug 156873 which got fixed in 3.2.2.
Comment 2 Thomas Watson CLA 2007-08-01 17:25:45 EDT
This may be released to bug 191652 which is fixed in HEAD for 3.4 and will be fixed in 3.3.1.  But I do not think this is the bug you are seeing because it does not sound like you actually updated your bundle's content.  Instead it seems you are updating the bundle simply to trigger a reload of the library.  Can you provide more information to reproduce?
Comment 3 Eclipse Genie CLA 2019-03-07 19:47:41 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.