In my project I am using a utility jar and in utility we have beans autowired.
When I am calling the method of jar it is giving null pointer exception at the place where autowired bean is used.
I tried to add package of jar in component scan of my project but still it is coming null.
below is the class from the jar file in which I a getting error
@Controller
public class UtilityController{
@Autowired
UtilityService utilityService;
public String getEmployeeDetails(String name){
Sting output = utilityService.getDetails(name);
--
--
}
getEmployeeDetails method is the one which I am trying to call from my code and utilityService is coming as null. I have the source code of jar and it is working fine when I am running it separately.