Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 310099 - Unclear exception message when a bundle cannot be resolved
Summary: Unclear exception message when a bundle cannot be resolved
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-22 08:05 EDT by Lazar Kirchev CLA
Modified: 2010-04-22 10:48 EDT (History)
1 user (show)

See Also:


Attachments
Sample bundle to reproduce the problem. (373 bytes, application/java-archive)
2010-04-22 08:07 EDT, Lazar Kirchev CLA
no flags Details
Proposition for a patch for the problem. (2.30 KB, patch)
2010-04-22 08:09 EDT, Lazar Kirchev CLA
tjwatson: iplog+
Details | Diff
Patch for the general case (3.03 KB, patch)
2010-04-22 10:15 EDT, Lazar Kirchev CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lazar Kirchev CLA 2010-04-22 08:05:42 EDT
Build Identifier: 3.5.2

When a bundle cannot be resolved due to unsatisfied constraints, the exception which is thrown does not contain the name of the bundle, which cannot be resolved.

Reproducible: Always

Steps to Reproduce:
1. Install the sample bundle 
2. Try to start it
3. See that the BundleException message does not contain the name of the bundle
Comment 1 Lazar Kirchev CLA 2010-04-22 08:07:45 EDT
Created attachment 165740 [details]
Sample bundle to reproduce the problem.

Sample bundle whose manifest contains an import, which cannot be wired.
Comment 2 Lazar Kirchev CLA 2010-04-22 08:09:03 EDT
Created attachment 165741 [details]
Proposition for a patch for the problem.

Patch which adds the name of the bundle to the exception's message.
Comment 3 Thomas Watson CLA 2010-04-22 09:37:55 EDT
Thanks.  I released the patch with a small change to use AbstractBundle.toString instead of BundleDescription.toString to get the information on the bundle.  I also quoted the bundle information in the message.
Comment 4 Thomas Watson CLA 2010-04-22 09:38:26 EDT
Comment on attachment 165741 [details]
Proposition for a patch for the problem.

Marking for iplog.  Thanks for the patch!
Comment 5 Lazar Kirchev CLA 2010-04-22 10:15:41 EDT
Created attachment 165766 [details]
Patch for the general case

It seems as if there is the same problem with the exception message when the bundle cannot be resolved for some other reason (not unsatisfied constraints) - it lacks the bundle name. This patch fixes this in just the same way. I do not open a new bug, because the problem is very similar.
Comment 6 Thomas Watson CLA 2010-04-22 10:48:10 EDT
Comment on attachment 165766 [details]
Patch for the general case

Thanks, I went ahead and released this patch also.  Thanks.  This case should be very rare and would actually indicate some other bug in the framework since we would be either missing the BundleDescription or have no errors available from the resolver for the unresolved bundle.