|Re: Problem with IEventBroker [message #749058 is a reply to message #740580]
||Tue, 25 October 2011 02:35
| Brian de Alwis
Registered: July 2009
As Tom alluded to earlier, you need to configure a Logger instance.|
Basically, the implementor of IEventBroker is org.eclipse.e4.ui.services.internal.events.EventBroker, configured using DS through an IContextFunction. If you look at its definition, you'll see that it requires a org.eclipse.e4.core.services.log.Logger instance to be injected. But Logger is neither provided through DS using an IContextFunction, nor is it an OSGi service. Rather, it is defined by E4Application as it sets up the application's default context (see E4Application#createDefaultContext()).
Because a Logger instance cannot be found, and Logger is abstract (and hence can't be instantiated by the injection framework), the injection of EventBroker fails, and so the injection of your BundleInit fails too.
If you changed your code to something like the following
Bundle bundle = FrameworkUtil.getBundle(getClass());
BundleContext bundleContext = bundle.getBundleContext();
IEclipseContext eclipseCtx =
// configure the logger
It would likely work (though you'll probably end up with an NPE from the null logger).
Powered by FUDForum
. Page generated in 0.01873 seconds