Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

Check whether the service is injected into the current controller page as mine, then

Private IUserService IUserService; “Without adding @autoWired

The correct application is

@Autowired
private IUserService iUserService;
Copy the code