- 博客(4)
- 收藏
- 关注
原创 Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded 。。。的解决办法
问题背景: 搭建了Springboot项目之后,初次启动项目,发现项目无法启动。检查依赖都已经导入。依旧报错:“Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.” 下面是我的错误的情景: 错误原因:在pom.xml文件中,配置了数据连接技术 spring-boot-starter-jdbc 的jar包,在启动配置文件时
2022-05-06 23:28:23
7460
1
原创 解决mybatis中mapper对象注入为null的问题
在springboot中测试mybatis-plus时的时候,在测试类中,注入UserMapper 结果测试的时候,一直报空指针异常,debug显示userMapper为null。 去检查启动类,mapperScan扫描包位置正确, UserMapper接口也添加了@Mapper注解。 反复检查是否依赖没有导入,检查无误。 最后,在测试类的上面添加了注解 @RunWith(SpringRunner.class) 问题解决!!! ...
2021-12-01 21:02:20
19224
10
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅