查找java.lang.NoClassDefFoundError的问题:org / apache / catalina / valves / ValveBase

时间:2013-07-25 22:18:32

标签: exception tomcat catalina

我正在尝试使用OpenID授权代码,但涉及到

WebAuthentication.login() 

抛出异常

java.lang.NoClassDefFoundError: org/apache/catalina/valves/ValveBase
    at org.jboss.web.tomcat.security.login.WebAuthentication.login(WebAuthentication.java:78)
    at dotastack.LoginServlet.doGet(LoginServlet.java:61)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    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:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    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:724)

我已将catalina.jar添加到WEB-INF \ lib,类路径,添加到Server Classpath,但这些方法都没有解决异常。帮帮我们,我做错了什么?谢谢。

1 个答案:

答案 0 :(得分:1)

您的错误是将catalina.jar添加到WEB-INF/lib。您不应该设置CLASSPATH环境变量。

如果您编写Valve,Valve本身需要位于Tomcat的lib/目录中。您无法将Valve与Web应用程序一起部署。