0

I have seen all the issues noticed in this forum, but I still don't have any solution for my problem. I work on a EAR project with Maven, Wildfly and JBoss. When I try to browse to my resource I have NPE. This is my JAX activator class:

import javax.ws.rs.ApplicationPath;

import javax.ws.rs.core.Application;

@ApplicationPath("/resource")
public class JaxRsActivator extends Application{

}

and this is my resource class:

@Path("/drivers")
public class DriverResource {

    @Inject DriverCpoServiceLocal driverCpoServiceLocal;

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public List<DriverCpo> doFindAllDrivers(){
        return driverCpoServiceLocal.findAll();
    }
}

This code works correctly on my personal computer, but in the work computer I see the NPE. It is driving me crazy.

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
majd hwas
  • 95
  • 2
  • 2
  • 10
  • Looks like a duplicate of [JavaEE Wildfly EJB not injected, war-only project](http://stackoverflow.com/questions/33719589/javaee-wildfly-ejb-not-injected-war-only-project/33719902#33719902) to me – Steve C Dec 26 '15 at 06:09
  • @stevec I don't know, the excellent answer you gave there would apply to any computer you run the project on, assuming the server it is running on is the same. But this is a "works on my computer" kind of question. – Gimby Dec 30 '15 at 09:42
  • please post the actual NPE you get, with full stacktrace. – Gimby Dec 30 '15 at 09:43

0 Answers0