IEventBroker injection into OSGI service component not working. #708

Submitted 2 years 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?


  2 years ago

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

  2 years 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.

  2 years ago

Please reopen if this still does not work for you.

Please login to write a comment.