Servlet.service() for servlet [dispatcherServlet] in context with path [] th报错
当我们做SpringMvc项目的时候,控制台报错信息 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.controller层没有加@ResponseBody
2.Service层实现类未添加注解@Autowired
3.@RestController使用成了@Controller
4.数据库连接:
Servlet.service() for servlet [dispatcherServlet] in context with path [] th报错修改方法:
还没有评论,来说两句吧...