Servlet.service() for servlet [dispatcherServlet] in context with path [] th

控制台报错信息

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

Servlet.service() for servlet [dispatcherServlet] in context with path [] th_第1张图片e

1.controller层没有加@ResponseBody

2.Service层实现类未添加注解@Autowired

3.@RestController使用成了@Controller

总结来说 就是springboot注解要正确使用,以及前后台的数据格式要一致。
记录一下,也希望对你有帮助。

Servlet.service() for servlet [dispatcherServlet] in context with path [] th_第2张图片

你可能感兴趣的:(SpringBoot,spring,boot,spring,java)