Consider defining a bean of type ‘Mapper‘ in your configuration.
错误信息
14:42:02.320 [restartedMain] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -
APPLICATION FAILED TO START
Description:
Field adMapper in com.qinghuan.cms.service.impl.AdServiceImpl required a bean of type ‘com.qinghuan.cms.mapper.AdMapper’ that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type ‘com.qinghuan.cms.mapper.AdMapper’ in your configuration.
解决
@Configuration
// 表示通过aop框架暴露该代理对象,AopContext能够访问
@EnableAspectJAutoProxy(exposeProxy = true)
// 指定要扫描的Mapper类的包的路径
@MapperScan(“com.ruoyi.**.mapper”)
public class ApplicationConfig
{
}
还没有评论,来说两句吧...