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 Jul 3, 2019
|
3
tudouxiong Jul 3, 2019 via Android 上 stackoverflow 求助 ✘
上 V2EX 求助 ✔ |
4
wc951 Jul 3, 2019 via Android
这和 mybatis 有什么关系,这不就是 spring 注入失败了吗
|
5
cway OP |
7
cluulzz Jul 3, 2019
|
8
MotherShip Jul 4, 2019
这是 Mybatis Plus 把
你说 SBoot 可以 SSM 不行,估计是少了什么 starter 中的配置,没配包扫描之类的。。 |
9
cway OP |
10
hafuhafu Jul 9, 2019
入口类上加注解 @MapperScan(mapper 包名)
大概 |
11
lavvrence Jul 19, 2019
BaseMapper 打上 @Repository 或者 @Mapper 看看
|