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)

相关推荐
小小鱼儿飞1 小时前
QT音乐播放器18----新歌速递播放、隐藏顶部和底部工具栏、自定义ToolTips
开发语言·qt
穆雄雄1 小时前
Rust 程序适配 OpenHarmony 实践:以 sd 工具为例
开发语言·rust·harmonyos
敏姐的后花园1 小时前
模考倒计时网页版
java·服务器·前端
0***141 小时前
Swift资源
开发语言·ios·swift
z***I3941 小时前
Swift Tips
开发语言·ios·swift
J***Q2921 小时前
Swift Solutions
开发语言·ios·swift
铅笔小新z1 小时前
C++入门指南:开启你的编程之旅
开发语言·c++
Gavin-Wang1 小时前
Swift + CADisplayLink 弱引用代理(Proxy 模式) 里的陷阱
开发语言·ios·swift
Dcs3 小时前
Java 中 UnaryOperator 接口与 Lambda 表达式的应用示例
java·后端