我是Azure和OpenIDConnect的新手。首先,我克隆了示例git Application并尝试对其进行测试。它给了我以下错误。战争中有oauth2 jar,我可以看到那里的类文件。
Git网址:https://github.com/Azure-Samples/active-directory-java-webapp-openidconnect
SEVERE: Exception starting filter BasicFilter
java.lang.NoClassDefFoundError: com/nimbusds/openid/connect/sdk/AuthenticationSuccessResponse
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getDeclaredMethods(Class.java:1860)
at org.apache.catalina.core.DefaultInstanceManager.processAnnotations(DefaultInstanceManager.java:335)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:119)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:252)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4584)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5262)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5257)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
... 16 more
答案 0 :(得分:0)
根据您的错误信息,似乎尚未安装示例项目的oauth2-oidc-sdk
文件中定义的pom.xml
依赖项。
mvn install
下载项目的依赖项。M2_HOME
是否为您的环境或IDE定义。希望它有所帮助。
答案 1 :(得分:0)
在tomcat lib中添加oauth-oidc-sdk.jar和gson.jar。该应用程序正在运行。