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

Injecting references with declarative services #103

Closed jhernandezb closed 8 years ago

jhernandezb commented 9 years ago

When trying to inject services into a Resource, the service always return null unless you defined the variable a static

@Component
@Path("greeting")
public class GreetingResource {
    private  static Connector conn;
    @Reference()
    public void setConn(final Connector conn){
        this.conn = conn;
    }

but the question is if this in any way could generate a problem when the service is unbind ed??

hstaudacher commented 9 years ago

hi, first how does this relate to the connector? I think this is a general problem you describe here. Maybe the mailing list of the OSGi implementation you use is the better place to ask this question.

As a side node. We are using the connector with Equinox and Equinox DS. All variables don't need to be static. So, this is not a connector problem.

hstaudacher commented 8 years ago

Please reopen if you think this is a connector problem.