IEventBroker injection into OSGI service component not working. #708

CLOSED learning portal
Submitted 5 months ago

The Eclipse Rich Client Training shows the following in the following section; 135.5. Notifications from the TaskService

@Component public class TransientTaskServiceImpl implements TaskService {

private IEventBroker broker;

The broker is null.

Is this because the IEclipseContext is not available for injection to OSGI service components in this way?


  5 months ago

Please see for using context functions. As said earlier OSGI does not support @Inject.

  5 months ago

I added the following text: Dependency inject only works here as we are using the ContextInjectionFactory in our context function implementation. OSGi does not natively support the '@Inject' annotation.

I hope this helps.

  5 months ago

Please reopen if this still does not work for you.

Please login to write a comment.