欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

非数据库映射接口mapper类自动注入报错:No qualifying bean of type 'com.zyc.redis.JwtRedisDAO' available: expected at

程序员文章站 2024-03-11 20:18:07
...

工具类的自动注入bean报错:

Error creating bean with name 'userServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:

No qualifying bean of type 'com.zyc.redis.JwtRedisDAO' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations

就是这里自动注入失败了: 

非数据库映射接口mapper类自动注入报错:No qualifying bean of type 'com.zyc.redis.JwtRedisDAO' available: expected at

网上找到答案全部都是指mapper映射文件对应的接口扫描不到的解决办法,不适合这种情况。

最终解决办法:

加上  @Component  注解

 非数据库映射接口mapper类自动注入报错:No qualifying bean of type 'com.zyc.redis.JwtRedisDAO' available: expected at

相关标签: SpingBoot spring