小工具知识网

当前位置: 首页 > 行业知识 > java.lang.NullPointerException: Cannot invoke “com.atguigu.mapper(because “this.userMapper“ is null)

行业知识

java.lang.NullPointerException: Cannot invoke “com.atguigu.mapper(because “this.userMapper“ is null)

2026-10-25 13:06:34 来源:互联网转载

记录一下一个错误。学习mybatisplus中遇到的:

java.lang.NullPointerException: Cannot invoke "com.atguigu.mapper.UserMapper.selectList(com.baomidou.mybatisplus.core.conditions.Wrapper)" because "this.userMapper" is null

解决办法就是加一个注解

@SpringBootTest

上一篇:设计怎么突出标题?

下一篇:Win10桌面图标消失之谜,一键解决桌面图标不见的烦恼!