baomidou Mabatis plus引入异常

1

主要异常信息 Error creating bean with name 'dataSource'

但是有个重要提示

dynamic-datasource Please check the setting of primary

解决方法:

复制代码
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
    <version>4.3.1</version>
</dependency>

2

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

如果你在单元测试中遇到这个错误,确保在测试类上使用了正确的注解来模拟Spring容器,如@RunWith(SpringRunner.class)@SpringBootTest

3

java.util.LinkedHashSet org.springframework.util.CollectionUtils.newLinkedHashSet(int)

相关推荐
G探险者8 分钟前
《如何在 Spring 中实现 MQ 消息的自动重连:监听与发送双通道策略》
java·开发语言·rpc
刘大猫2615 分钟前
Datax安装及基本使用
java·人工智能·算法
Kyrie_Li27 分钟前
(十五)Spring Test
java·后端·spring
马里奥Mario34 分钟前
拯救被日志拖垮的线程池:Logback异步化改造实战
java
程序无bug42 分钟前
Spring 当中的Bean 作用域
java
weixin_437398211 小时前
转Go学习笔记
linux·服务器·开发语言·后端·架构·golang
RainbowSea1 小时前
补充:问题:CORS ,前后端访问跨域问题
java·spring boot·spring
StrongerIrene1 小时前
rs build 的process.env的值undefined解决方案
开发语言·javascript·ecmascript
RainbowSea1 小时前
15. MySQL 多版本并发控制
java·sql·mysql
倔强的石头1061 小时前
飞算JavaAI:重构软件开发范式的智能引擎
java·数据库·重构