使用jwt0.11.1导致版本报错

在使用jwt时运行报错,记录一下

报错信息:

[Unable to load class named [io.jsonwebtoken.impl.DefaultJwtBuilder] from the thread context, current, or system/application ClassLoaders. All heuristics have been exhausted. Class could not be found. Have you remembered to include the jjwt-impl.jar in your runtime classpath?]

在这里插入图片描述
出现如上报错是因为导入的包少了:
如图所示我只导入了:
在这里插入图片描述
正确的还缺少另外两个包,完整的导入如下:
在这里插入图片描述

<dependency>
    <groupId>io.jsonwebtoken</groupId>
    <artifactId>jjwt-api</artifactId>
    <version>0.11.1</version>
</dependency>
<dependency>
    <groupId>io.jsonwebtoken</groupId>
    <artifactId>jjwt-impl</artifactId>
    <version>0.11.2</version>
</dependency>
<dependency>
    <groupId>io.jsonwebtoken</groupId>
    <artifactId>jjwt-jackson</artifactId>
    <version>0.11.2</version>
</dependency>

猜你喜欢

转载自blog.csdn.net/qq_60361946/article/details/128402295