gpt4 book ai didi

java.lang.ClassNotFoundException : org. owasp.encoder.Encode

转载 作者:行者123 更新时间:2023-11-30 03:50:02 28 4
gpt4 key购买 nike

我正在尝试在我的 java 类中使用 OWASP 编码器库来对输入进行编码,但我没有任何运气。它一直给我这个

java.lang.ClassNotFoundException: org.owasp.encoder.Encode and java.lang.NoClassDefFoundError: org/owasp/encoder/Encode

我将 JAR 包含在 -classpath 中关于编译。不知道还能尝试什么

/usr/java/jdk1.6.0_20/bin/javac -classpath /path:/path/encoder-1.1.1.jar xxxx.java

这是堆栈跟踪:

java.lang.ClassNotFoundException: org.owasp.encoder.Encode
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
at xxxxxx.doGet(xxxxxx.java:15)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
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:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
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:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

谢谢

最佳答案

它还需要运行时类路径中存在该 jar

像这样运行

/usr/java/jdk1.6.0_20/bin/java -classpath /path:/path/encoder-1.1.1.jar xxxx

关于java.lang.ClassNotFoundException : org. owasp.encoder.Encode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24684699/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com