2012-06-28 159 views
0

我在tomcat5.5服務器上運行任何JSP時出現此異常。是否需要添加任何JAR?請幫忙。運行JSP時出現異常

堆棧跟蹤:

DEBUG http-8181-Processor25 org.apache.catalina.loader.WebappClassLoader - Loading class from parent 
FATAL http-8181-Processor25 org.apache.jasper.runtime.JspFactoryImpl - Exception initializing page context 

java.lang.NoSuchMethodError: org.apache.tomcat.util.http.ServerCookie.appendCookieValue(Ljava/lang/StringBuffer;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)V 
    at org.apache.catalina.connector.Response.addCookieInternal(Response.java:970) 
    at org.apache.catalina.connector.Request.doGetSession(Request.java:2285) 
    at org.apache.catalina.connector.Request.getSession(Request.java:2031) 
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:832) 
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:843) 
    at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:136) 
    at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:113) 
    at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:105) 
    at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:62) 
    at org.apache.jsp.banner_jsp._jspService(banner_jsp.java:33) 
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) 
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) 
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) 
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) 
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) 
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) 
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) 
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) 
    at java.lang.Thread.run(Thread.java:619) 
DEBUG http-8181-Processor25 org.apache.catalina.loader.WebappClassLoader - loadClass(javax.servlet.jsp.PageContext, false) 

回答

1

檢查,如果你有tomcat-coyote.jar$CATALINA_BASE/shared/lib/文件夾中。如果以某種方式存在,則在啓動服務器時未將其加載到類路徑中。檢查你的conf這行/ catalina.properties

server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar 

如果是的話那麼可能是你需要更新。你正在使用什麼環境。

+0

LOGS:DEBUG main org.apache.jasper.compiler.JspRuntimeContext - 編譯classpath初始化:/D:/Soft/apache-tomcat-5.5.27/server/lib/tomcat-coyote.jar(我可以看到tomcat- coyote.jar在與其他罐子的類路徑) – VJS

+0

然後更新罐子 –

+0

Okes ...讓我檢查...在Windows上使用tomcat5.5.27 ...我使用非常基本的JSP.Does這意味着我們不能運行JSP上的tomcat 5.5.27 – VJS

0

我認爲這個問題更多的是你正在使用的jar版本,或者你是在你的類路徑中的jar。它試圖指向正確的類版本,因爲所需的方法不可用。哪些所有罐子已經在你的類路徑中設置?

0

你不錯過任何罐子。否則,你會得到ClassNotFound exceptionNoSuchMethodError表示罐子不兼容。你是否有機會改變(或從不同位置複製)/ lib中的jar文件,特別是jasper*.jar, tomcat-coyote