service层调用dao层时报错java.lang.NullPointerException的解决办法

2022-09-13 14:29:13
错误:

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

debug:

发现在service层调用dao层插入时崩了,一脸懵逼。
在这里插入图片描述

结决办法:

原来是引入 private ClassRoomDoMapper classRoomDoMapper; 时忘了加
@Autowired 注解 导致无法自动装配bean 加上注解问题解决

在这里插入图片描述

  • 作者:落落落Luo
  • 原文链接:https://blog.csdn.net/qq_41870790/article/details/103100075
    更新时间:2022-09-13 14:29:13