Unable to invoke class method io.jsonwebtoken.impl.crypto.MacProvider#generateKey. Ensure the necessary implementation is in the runtime classpath. springboot使用jjwt遇到问题
我在pom.xml里导入了依赖
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.11.2</version>
</dependency>
测试类里的代码
@Test
public void test() {
Key key = Keys.secretKeyFor(SignatureAlgorithm.HS256);
String jws = Jwts.builder()
.setSubject("zhangsan")
.signWith(key)
.compact();
System.out.println(jws);
}
实在不知道哪里错了也没有人帮忙看看