我在tomcat服务器上有两个应用程序(比如App1和App2)。两者都在C:\ Tomcat7_0_29 \ webapps \ AppX \ WEB-INF \ lib文件夹中有ESAPI-2.0-rc5.jar。 App2正在使用opensaml-2.6.0.jar(在C:\ Tomcat7_0_29 \ webapps \ App2 \ WEB-INF \ lib文件夹中)来满足SAML需求。
现在,每当我尝试在 App1 中对字段数据进行编码时,都会出现 java.lang.ClassNotFoundException: org.opensaml.ESAPISecurityConfig
错误。
尝试了很多选择,从来没有让它们一起工作。请帮忙
完整堆栈跟踪:
org.owasp.esapi.errors.ConfigurationException: java.lang.ClassNotFoundException: org.opensaml.ESAPISecurityConfig SecurityConfiguration class (org.opensaml.ESAPISecurityConfig) must be in class path.
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:113)
at org.owasp.esapi.ESAPI.securityConfiguration(ESAPI.java:445)
at org.owasp.esapi.ESAPI.encoder(ESAPI.java:208)
at xxx.xxx.xxxx.xx.removeBadChars(BaseObject.java:131)
at xxx.xxx.xxxx.xx.convert(ClaimsUtil.java:45)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.opensaml.ESAPISecurityConfig
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:85)
... 24 more
答案 0 :(得分:2)
检查以确保opensaml的库位于类路径中。如果这个简单的解决方案不是......
查看最新版opensaml的maven repo:
http://mvnrepository.com/artifact/org.opensaml/opensaml/2.6.1
看起来opensaml库依赖于esapi 2.0.1,可能发生的事情是在{1}}依赖于opensaml之前加载ESAPI-2.0-rc5.jar
。对于无法克隆环境的人来说,唯一的指导是尝试下载opensaml的源代码,并在更新其依赖关系管理以指向您的ESAPI版本后构建它。
答案 1 :(得分:0)
面对完全相同的问题, 我如何解决这个问题,方法是将 opensaml-2.6.1.jar 文件复制到tomcat共享/公共lib文件夹" / tomcat / lib /."