非数据库映射接口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映射文件对应的接口扫描不到的解决办法,不适合这种情况。
最终解决办法:
加上 @Component 注解