0 Replies Latest reply on Nov 21, 2013 4:37 PM by Rich Midwinter

    Can't seem to make a simple CDI @Inject work

    Rich Midwinter Newbie

      I've got a Resteasy JAX-RS "singleton":

       

      @RequestScoped

      @Path("/history")

      public class HistoryAPI {

       

      @Inject

        private History history;

      ...

       

      And the bean I'm trying to inject:

       

      @ApplicationScoped

      public class History {

      ...


      With a beans.xml in my WEB-INF. Using Beta1. I've tried bundling the resteasy dependencies including the CDI one, and tried leaving them provided by wildfly. I've also tried a random scattering of other annotations but these are just about the minimum I thought were required.


      No matter what I try, I seem to get an NPE in HistoryAPI where history.someMethod() is called. Any suggestions? Thanks in advance.