码上敲享录 > Spring框架常见问题详解分享 > nested exception is java.lang.NullPointerException] with root cause

nested exception is java.lang.NullPointerException] with root cause

上一章章节目录下一章 2019-07-14已有20709人阅读 评论(0)

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


原因:

Service层实现类未添加注解@Autowired或 @Resource。

@Resource和@Autowired的作用是自动注入依赖的Bean。


解决方法:

加上注解@Autowired或 @Resource。



向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
432

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交