今天在使用springboot的过程中,遇到了Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause错误,着实难受,记录一下。
错误原因:
我在service实现类中引用了两个资源包文件,但是只写了一个@Autowared,这样只自动注入了第一个包,而第二个包并没有注入,所以应该再写一个@Autowared
这样我的问题就解决了!
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request p
最新推荐文章于 2024-06-25 15:47:04 发布