我正在运行wso2is版本5.7,并试图实现一个基于msf4j JWTAccessTokenBuilder的TokenGenerator。
我的identity.xml包括
com.wso2.jwt.token.builder.JWTAccessTokenBuilder org.wso2.carbon.identity.oauth.tokenvaluegenerator.SHA256Generator
当我登录时,会引发异常。
2019-05-16 18:27:18,163错误{org.apache.catalina.core.StandardWrapperValve} - Servlet.service()在带有路径的servlet OAuth2Endpoints中抛出异常java.lang.RuntimeException: com/nimbusds/jwt/ReadOnlyJWTClaimsSet at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116) 在org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:336) 在org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) 在org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249) 在org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248) ..。 在org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 在java.lang.Thread.run(Thread.java:748)引起的: org.apache.cxf.interceptor.Fault: com/nimbusds/jwt/ReadOnlyJWTClaimsSet 在org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:170) 在org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:136) 在org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:204) 在org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:101) 在org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) 在org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94) 在org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) . 49多个原因: java.lang.NoClassDefFoundError: com/nimbusds/jwt/ReadOnlyJWTClaimsSet 在java.lang.Class.getDeclaredConstructors0(Native方法中) 在java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ..。 在java.lang.reflect.Method.invoke(Method.java:498) 在org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:188) 在org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:104) .54个原因: java.lang.ClassNotFoundException: com.nimbusds.jwt.ReadOnlyJWTClaimsSet无法被JWTAccessTokenBuilder_2.7.4.SNAPSHOT找到
有人能给我个提示吗?
发布于 2019-06-06 07:59:54
我发现了问题:我使用了一个旧版本的org.wso2.carbon.identity.inbound.auth.oauth2,我将pom.xml更新为
<dependency>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
<version>6.0.172</version>
<scope>provided</scope>
</dependency>必须更新代码才能使用https://mvnrepository.com使用的com.nimbusds.jwt版本。最后,在服务提供者设置中,您必须选择令牌发布器。
发布于 2019-05-17 14:11:47
根据错误com.nimbusds.jwt.ReadOnlyJWTClaimsSet cannot be found by JWTAccessTokenBuilder_2.7.4.SNAPSHOT,这是由于OSGi类绑定。在pom的maven-bundle-plugin配置导入包中,请确保您拥有具有正确版本范围的com.nimbusds.jwt。
或者,快速修复是添加<DynamicImport-Package>*</DynamicImport-Package>
https://stackoverflow.com/questions/56173061
复制相似问题