javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean: java.lang.NoClassDefFoundError: com/auth0/jwt/algorithms/Algorithm
at com.sun.ejb.containers.EJBContainerTransactionManager.checkExceptionClientTx(EJBContainerTransactionManager.java:668)
at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:509)
我的进口货
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
令牌方法的创建
try {
Algorithm algorithm = Algorithm.HMAC512("secret");
token
=JWT.create().withSubject(username).withIssuer("OAuth").sign(algorithm);
} catch (Exception e) {
return null;
}
我不知道这个错误是如何显示的,因为Jwt库是通过在maven中将a t作为依赖项导入而提供的。
有什么办法吗?
在EJB容器中遇到TransactionRolledbackLocalException,异常源于找不到com.auth0.jwt.algorithms.Algorithm类。问题可能在于JWT库的依赖没有正确引入或者未在运行环境中加载。检查Maven配置,确保com.auth0.jwt库已添加为依赖,并确认项目构建过程中没有排除相关模块。尝试清理并重新构建项目以解决这个问题。
5017

被折叠的 条评论
为什么被折叠?



