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

工具类的自动注入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_第1张图片

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

最终解决办法:

加上  @Component  注解

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

你可能感兴趣的:(SpingBoot)