Inject an EJB into JAX-RS (RESTful service)
I am not sure this is supposed to work. So either: Option 1: Use the injection provider SPI Implement a provider that will do the lookup and inject the EJB. See: @EJB injection. Example for com.sun.jersey:jersey-server:1.17 : import com.sun.jersey.core.spi.component.ComponentContext; import com.sun.jersey.core.spi.component.ComponentScope; import com.sun.jersey.spi.inject.Injectable; import com.sun.jersey.spi.inject.InjectableProvider; import javax.ejb.EJB; import javax.naming.Context; import javax.naming.InitialContext; import javax.ws.rs.ext.Provider; import java.lang.reflect.Type; … Read more