Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Bug in org.eclipse.e4.core.di?
Bug in org.eclipse.e4.core.di? [message #799464] Wed, 15 February 2012 18:22 Go to previous message
Karl Weber is currently offline Karl Weber
Messages: 63
Registered: September 2010
Member
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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:@Preference(value="data") as value for other Annotation
Next Topic:RCP can not say hello world
Goto Forum:
  


Current Time: Mon May 20 05:35:48 EDT 2013

Powered by FUDForum. Page generated in 0.02108 seconds