| Summary: | NullPtrException from uninstall of CompositeBundle | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Chris <wilkobets> | ||||
| Component: | Framework | Assignee: | equinox.framework-inbox <equinox.framework-inbox> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | alasdair, sptaszkiewicz, tjwatson | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Chris
Created attachment 187841 [details]
stacktrace of exception
Stack trace of the NPE
Can you give some hints as to the inconsistent state in your code? Is the bundle already uninstalled or something like that? Hi, I've been having this problem with code in the apache aries project. When the code was opting to uninstall a composite bundle it was doing the following: compositeBundle.stop(); compositeBundle.uninstall(); The stop call resulted in all bundles in the companianFramework being removed, even the system bundle. When uninstall is called it tries to get the surrogate bundle (bundle 1) and to do that it inits the framework. This results in the system bundle being "installed" but not the surrogate bundle. So the attempt to get bundle 1 results in null being returned. The code then calls getDelegate on bundle 1 which is null so you get the NPE. Removing the call to stop appears to have solve the problem, although I am concerned that it could cause other problems down the line. (In reply to comment #3) > Hi, > > I've been having this problem with code in the apache aries project. When the > code was opting to uninstall a composite bundle it was doing the following: > > compositeBundle.stop(); > compositeBundle.uninstall(); > > The stop call resulted in all bundles in the companianFramework being removed, > even the system bundle. When uninstall is called it tries to get the surrogate > bundle (bundle 1) and to do that it inits the framework. This results in the > system bundle being "installed" but not the surrogate bundle. So the attempt to > get bundle 1 results in null being returned. The code then calls getDelegate on > bundle 1 which is null so you get the NPE. > > Removing the call to stop appears to have solve the problem, although I am > concerned that it could cause other problems down the line. Are you certain that you are not uninstalling constituent bundles from the composite in some BundleListener that is listening to STOPPING events when you stop the composite. Stopping the composite should not cause all the constituent bundles to become uninstalled. I am unable to reproduce this at this point. As mentioned in comment 4, this problem is not reproducible. Please reopen if you still see the problem in a more recent version of Equinox. (In reply to Szymon Ptaszkiewicz from comment #5) > As mentioned in comment 4, this problem is not reproducible. Please reopen > if you still see the problem in a more recent version of Equinox. More importantly the composite bundle (which was provisional API) was removed in the Luna release so there will be no way of reproducing on the most recent release. |