Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314814 - NPE in AbstractBundleContainer if there is no FrameWorkAdmin service which requires silently the Declaration Service
Summary: NPE in AbstractBundleContainer if there is no FrameWorkAdmin service which re...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 315177 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-28 04:12 EDT by Aurelien Pupier CLA
Modified: 2011-02-01 14:17 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Pupier CLA 2010-05-28 04:12:04 EDT
Build Identifier: 20100520-1308

The NPE error is not really explicit. At least, tells that the service is missing would be better.

In fact, in 3.5, the service was launched in the start of the Activator.
In 3.6, it uses the Declaration Service so the plugin org.eclipse.equinox.ds is required.

I think that a lot of migration will encountered this error. Thats why it will be great to fix it for 3.6.

Reproducible: Always

Steps to Reproduce:
1. launch an RCP application without org.eclipse.equinox.ds (ie when you are migrationg from 3.5, you will not have it)
2. 
3.
Comment 1 Darin Wright CLA 2010-05-28 09:23:14 EDT
Could you add/complete the "steps"? As well, isn't the workaround to include org.eclipse.equinox.ds?
Comment 2 Aurelien Pupier CLA 2010-05-28 09:34:14 EDT
(In reply to comment #1)
> Could you add/complete the "steps"?
I don't know exactly what actions called this method of AbstractBundleContainer but building a plugin project might do this

> As well, isn't the workaround to include
> org.eclipse.equinox.ds?

Yes it is :) but a lot people might be confronted with this issue and it will be better if it is explicit that they required org.eclipse.equinox.ds (to have FrameWorkAdmin service)
Comment 3 Darin Wright CLA 2010-05-28 09:39:22 EDT
(In reply to comment #0)
> Steps to Reproduce:
> 1. launch an RCP application without org.eclipse.equinox.ds (ie when you are
> migrationg from 3.5, you will not have it)

I'm just wondering how 'critical' this. I'm not sure many RCP applications include PDE. As well, I'm not sure that PDE should be requiring DS, since PDE does not know how the FrameWorkAdmin service is provided. PDE just retrieves the service from OSGi... the fact that DS is used is an implementation detail of the service.
Comment 4 Aurelien Pupier CLA 2010-05-28 09:47:31 EDT
(In reply to comment #3)
> (In reply to comment #0)
> > Steps to Reproduce:
> > 1. launch an RCP application without org.eclipse.equinox.ds (ie when you are
> > migrationg from 3.5, you will not have it)
> 
> I'm just wondering how 'critical' this. I'm not sure many RCP applications
> include PDE. As well, I'm not sure that PDE should be requiring DS, since PDE
> does not know how the FrameWorkAdmin service is provided. PDE just retrieves
> the service from OSGi... the fact that DS is used is an implementation detail
> of the service.

I thought it is critical in the way that if the service doesn't exist, some features of PDE doesn't work and the only hint is a NPE.

And yes, perhaps not so many RCP application will be affected. I didn't think that it is PDE.
Comment 5 John Arthorne CLA 2010-05-28 13:58:10 EDT
(In reply to comment #3)
> I'm just wondering how 'critical' this. I'm not sure many RCP applications
> include PDE. As well, I'm not sure that PDE should be requiring DS, since PDE
> does not know how the FrameWorkAdmin service is provided. PDE just retrieves
> the service from OSGi... the fact that DS is used is an implementation detail
> of the service.

Yes. No bundle should have a direct dependency on org.eclipse.equinox.ds since it doesn't provide any API. Especially here, it is another bundle that is using ds to publish its service, and the PDE code is just consuming the service in the traditional OSGi manner.
Comment 6 Darin Wright CLA 2010-05-28 14:06:52 EDT
Reducing severity. It's not critical in the sense that the Eclipse SDK is broken - it's a configration error (that is potentially difficult to diagnose) in the RCP app. PDE should improve handling of the missing service - i.e. log a message if it cannot be found.
Comment 7 Curtis Windatt CLA 2010-05-31 11:08:33 EDT
The only thing PDE will fix here is the NPE.  We use the framework admin service all over in PDE code, but we do not care who provides the service (or whether it is a DS).

Reducing severity to normal.  Marking for 3.7.  We can consider putting this into 3.6.1.
Comment 8 Curtis Windatt CLA 2010-06-01 09:17:18 EDT
*** Bug 315177 has been marked as a duplicate of this bug. ***
Comment 9 Aurelien Pupier CLA 2010-07-13 13:31:46 EDT
Perhaps we can follow the same way than in e4:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=318821

ie display a warning in launch configuration.
Comment 10 Curtis Windatt CLA 2011-02-01 14:17:27 EST
Added the NPE guards to HEAD.  See AbstractBundleContainer.java  If the service is not available, we will just skip trying to load the vm arguments from the running application.