How to enable CDI inject in web service (jaxrs/jersey) on java se running grizzly?
How do I allow CDI injection of resources into restful web service resources? I am running on standard java using weld 2 (cdi), jersey (jaxrs), and grizzly (web server). Here is my simple web resource: import training.student.StudentRepository; import javax.inject.Inject; import javax.ws.rs.*; @Path("student") public class StudentWebResource { @Inject private StudentRepository studentRepository; @GET @Path("count") @Produces(MediaType.TEXT_PLAIN) public Integer getCount() { return studentRepository.studentCount(); } } And here is how I've got weld starting my simple web server: public class