I am trying to create a java application that can send HTTP requests and is connected to a database using Jersey framework. I have written the DAO,Service and Controller classes but I am getting this error “java.lang.NullPointerException: Cannot invoke “com.Service.getById(String)” because “this.Service” is null.
I have used @inject annotation to create the object of the service class and used @singleton annotation for the service class. But i am unable to resolve the error .
Lourdu Kishore Pragada is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1