I first posted this question in the equinox forum, but now I suspect it may be a bug in e4.
I get the following exception
org.eclipse.e4.core.di.InjectionException: Unable to process "WorkbenchStatusReporter.shellProvider": no actual value was found for the argument "IShellProvider".
The problem can be traced down to the following piece of code
@Inject
private ConfigurationAdmin fConfigAdmin;
that is located in a dialog DBLocationDialog, which is opened through a menu-handler, as given here
public class DBLocationHandler {
@Execute
public void execute(IEclipseContext context) {
DBLocationDialog dialog = ContextInjectionFactory.make(DBLocationDialog.class, context);
dialog.open();
}
}
As written in my post cited above, the problem only occurs, when the configuration admin bundle is started with default startlevel and default auto-start. When that bundle is started with auto-start true, the exception is not thrown, i.e. the injection in the dialog succeeds.
Now I get the same exception with a test component of mine. The code causing the exception is again
@Inject
private ITest fTest;
The interface is implemented through a lazily activating component. At first, the service ITest is not used, as shown in the osgi console
{de.trm.app.ITest}={component.name=de.trm.app.Component, component.id=9, service.id=43}
"Registered by bundle:" de.trm.app_1.0.0.qualifier [53]
"No bundles using service."
The component is not activated yet. When the same dialog is called through the same menu-handler, the same exception occurs, but the component is activated right before:
osgi> $$$ COMPONENT STARTING
org.eclipse.e4.core.di.InjectionException: Unable to process "WorkbenchStatusReporter.shellProvider": no actual value was found for the argument "IShellProvider".
The text "$$$ COMPONENT STARTING" is written to System.out in the Activate-method of the test component. Now the osgi console says
{de.trm.app.ITest}={component.name=de.trm.app.Component, component.id=9, service.id=43}
"Registered by bundle:" de.trm.app_1.0.0.qualifier [53]
"Bundles using service"
org.eclipse.e4.ui.workbench_0.10.1.v20120126-1604 [48]
Since e4 is now using this component, why fails the injection of ITest? To me it looks as if it is a bug in e4.
Well, I am using 4.2M5 as Target.