hstaudacher / osgi-jax-rs-connector

An OSGi - JAX-RS 2.0 Connector, software repository available on the link below
http://hstaudacher.github.io/osgi-jax-rs-connector
Other
190 stars 98 forks source link

Declarative Services not found by Jersey #161

Open osx2000 opened 8 years ago

osx2000 commented 8 years ago

My Setup is basically like the code below - my Root Rest Resources depend on other Services which created and injected just fine by Felix.

@Component(immediate = true, service = RESTService.class)
@Path("/hello)
public class RESTServiceImpl {
protected AnotherComponent anotherComponent;

@Reference
public void setAnotherComponent(AnotherComponent anotherComponent) {
   this.anotherComponent = anotherComponent;
}

@GET
public String hello() {
   return anotherComponent.hello();
}
}

When osgi-jax-rs-connector.publisher tries to register my Root Rest Resources with Jersey (ServletContainerBridge), Jersey fails to inject an object in org.jvnet.hk2.internal.Utilities.justInject , and Jersey won't start up.

What do I miss here?

Do I need to implement and register Custom Injection (org.glassfish.hk2.api.Factory)?

BryanHunt commented 7 years ago

My guess is that AnotherComponent has not been activated and is gating the activation of the RESTServiceImpl.