【发布时间】:2018-06-27 01:43:41
【问题描述】:
我正在尝试自动装配从这个包 io.jsonwebtoken.JwtBuilder 导入的 JJWT JwtBuilder,但是我收到如下所示的错误(在问题的末尾)
我在自动装配我自己的类时修复了一个类似的错误通过在我导入的库的开头使用@service 注释,但是由于这是一个标准库,我无法添加@service 注释给它
我在我的 impl 文件中这样调用库:
import io.jsonwebtoken.JwtBuilder;
....
@Autowired
JwtBuilder jwtBuilder;
gradle中的依赖是
compile 'io.jsonwebtoken:jjwt:0.9.0'
错误:
APPLICATION FAILED TO START
***************************
Description:
Field jwtBuilder in ....CustomerServiceImpl required a bean of type 'io.jsonwebtoken.JwtBuilder' that could not be found.
Action:
Consider defining a bean of type 'io.jsonwebtoken.JwtBuilder' in your configuration.
【问题讨论】:
标签: java spring spring-boot autowired jjwt