I have some problem with injecting dependencies to the project. In my case I have WAR file with some specialized GWT handlers, and jar with dispatcher classes (dispatcher + common: actions, handlers, results). In this jar I try scan all Handlers and automatically register them:
@Inject
private void init(@Any Instance<ActionHandler<?, ?>> handlers) {
...
InstanceActionHandlerRegistry registry = new DefaultActionHandlerRegistry();
for (ActionHandler<?, ?> handler : handlers) {
registry.addHandler(handler);
}
...
}
The problem is that all handlers from jar are registered but Handlers from WAR are not. Both jar and war file have beans.xml files. Does anyone know what I should do to force find all instances of handlers - not only listed in library jar file?