org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'forecastServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.baomidou.mybatisplus.mapper.BaseMapper com.baomidou.mybatisplus.service.impl.ServiceImpl.baseMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.baomidou.mybatisplus.mapper.BaseMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 实在不知道哪里错了,求助大家帮搜搜
2
fooving 2019-07-03 10:44:51 +08:00
|
3
tudouxiong 2019-07-03 11:14:19 +08:00 via Android 1
上 stackoverflow 求助 ✘
上 V2EX 求助 ✔ |
4
wc951 2019-07-03 14:32:05 +08:00 via Android
这和 mybatis 有什么关系,这不就是 spring 注入失败了吗
|
5
cway OP |
7
cluulzz 2019-07-03 23:31:54 +08:00
|
8
MotherShip 2019-07-04 10:46:27 +08:00
这是 Mybatis Plus 把
你说 SBoot 可以 SSM 不行,估计是少了什么 starter 中的配置,没配包扫描之类的。。 |
9
cway OP |
10
hafuhafu 2019-07-09 08:22:22 +08:00
入口类上加注解 @MapperScan(mapper 包名)
大概 |
11
jaylee4869 2019-07-19 09:57:18 +08:00
BaseMapper 打上 @Repository 或者 @Mapper 看看
|