IEventBroker injection into OSGI service component not working. #708
CLOSED
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 {
@Inject private IEventBroker broker;
The broker is null.
Is this because the IEclipseContext is not available for injection to OSGI service components in this way?
Please login to write a comment.
Comments
Please see https://learn.vogella.com/exercises/rich-client-platform/using-context-functions-ACy8M#tutorial_contextfunction2 for using context functions. As said earlier OSGI does not support @Inject.
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.
See https://learn.vogella.com/exercises/rich-client-platform/using-context-functions-ACy8M#tutorial_contextfunction5
Please reopen if this still does not work for you.