Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Declarative Services not found by Jersey #161

Open
osx2000 opened this issue May 24, 2016 · 1 comment
Open

Declarative Services not found by Jersey #161

osx2000 opened this issue May 24, 2016 · 1 comment

Comments

@osx2000
Copy link

osx2000 commented May 24, 2016

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
Copy link
Collaborator

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants