How to enable CDI inject in web service (jaxrs/jersey) on java se running grizzly?
After seeing this stackoverflow post, I implemented the following solution. Not sure if it is the best route to take, but it worked. I created an hk2 Binder and registered the Binder: public class WebServiceBinder extends AbstractBinder { @Override protected void configure() { BeanManager bm = getBeanManager(); bind(getBean(bm, StudentRepository.class)) .to(StudentRepository.class); } private BeanManager getBeanManager() { … Read more