2014-09-02 296 views
3

我試圖在Red5 0.9.0服務器上運行帶有嵌入式tomcat-6.0.24的war文件。未找到JSP類異常

部署WAR文件後,我可以成功訪問索引頁面。但是,當我嘗試訪問其他任何JSP頁面,系統將引發類似的錯誤:

java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.pages.form.loginMai n_jsp$Helper

我已經搜查工作文件夾,我可以找到類:

[red5- home]\work\red5Engine\0.0.0.0\myApp\org\apache\jsp\WEB_002dINF\pages\form\loginMain_jsp$Helper.class

我不明白爲什麼tomcat的不能找到這個jsp類。請幫忙。

這是錯誤的完整堆棧跟蹤:

[ERROR] [http-0.0.0.0-5080-1] org.apache.catalina.core.ContainerBase.[red5Engine ].[0.0.0.0].[/myApp].[jsp] - Servlet.service() for servlet jsp threw exception java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.pages.form.loginMai n_jsp$Helper 
     at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [na:1.7.0_40] 
     at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [na:1.7.0_40] 
     at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_ 40] 
     at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [na:1.7.0_ 40] 
     at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:13 4) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66) [jasper-6.0.24.jar:na] 
     at java.lang.Class.getDeclaredConstructors0(Native Method) [na:1.7.0_40] 

     at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483) [na:1 .7.0_40] 
     at java.lang.Class.getConstructor0(Class.java:2793) [na:1.7.0_40] 
     at java.lang.Class.newInstance(Class.java:345) [na:1.7.0_40] 
     at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrap per.java:145) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspSer vletWrapper.java:480) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:338) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3 13) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) [ja sper-6.0.24.jar:na] 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [javaee- api-5.1.1.jar:5.1.1] 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:290) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.java:646) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica tionDispatcher.java:436) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD ispatcher.java:374) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis patcher.java:302) [catalina-6.0.24.jar:na] 
     at org.springframework.web.servlet.view.InternalResourceView.renderMerge dOutputModel(InternalResourceView.java:239) [spring-webmvc-3.0.0.RELEASE.jar:3.0 .0.RELEASE] 
     at org.springframework.web.servlet.view.AbstractView.render(AbstractView .java:250) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.DispatcherServlet.render(DispatcherSe rvlet.java:1060) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch erServlet.java:798) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche rServlet.java:716) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame workServlet.java:647) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServl et.java:552) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) [javaee- api-5.1.1.jar:5.1.1] 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [javaee- api-5.1.1.jar:5.1.1] 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:290) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) [catalina-6.0.24.jar:na] 
     at org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.jav a:87) [red5.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:235) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) [catalina-6.0.24.jar:na] 
     at org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern al(CharacterEncodingFilter.java:88) [spring-web-3.0.0.jar:3.0.0.RELEASE] 
     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR equestFilter.java:76) [spring-web-3.0.0.jar:3.0.0.RELEASE] 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:235) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:233) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:191) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica torBase.java:465) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:127) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:102) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: 555) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:109) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav a:298) [catalina-6.0.24.jar:na] 
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :852) [tomcat-coyote-6.0.24.jar:na] 
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce ss(Http11Protocol.java:588) [tomcat-coyote-6.0.24.jar:na] 
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48 9) [tomcat-coyote-6.0.24.jar:na] 
     at java.lang.Thread.run(Thread.java:724) [na:1.7.0_40] [ERROR] [http-0.0.0.0-5080-1] org.apache.catalina.core.ContainerBase.[red5Engine ].[0.0.0.0].[/myApp].[myApp] - Servlet.service() for servlet myApp threw excepti on java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.pages.form.loginMai n_jsp$Helper 
     at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [na:1.7.0_40] 
     at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [na:1.7.0_40] 
     at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_ 40] 
     at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [na:1.7.0_ 40] 
     at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:13 4) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66) [jasper-6.0.24.jar:na] 
     at java.lang.Class.getDeclaredConstructors0(Native Method) [na:1.7.0_40] 

     at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483) [na:1 .7.0_40] 
     at java.lang.Class.getConstructor0(Class.java:2793) [na:1.7.0_40] 
     at java.lang.Class.newInstance(Class.java:345) [na:1.7.0_40] 
     at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrap per.java:145) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspSer vletWrapper.java:480) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:338) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3 13) [jasper-6.0.24.jar:na] 
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) [ja sper-6.0.24.jar:na] 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [javaee- api-5.1.1.jar:5.1.1] 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:290) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.java:646) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica tionDispatcher.java:436) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD ispatcher.java:374) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis patcher.java:302) [catalina-6.0.24.jar:na] 
     at org.springframework.web.servlet.view.InternalResourceView.renderMerge dOutputModel(InternalResourceView.java:239) [spring-webmvc-3.0.0.RELEASE.jar:3.0 .0.RELEASE] 
     at org.springframework.web.servlet.view.AbstractView.render(AbstractView .java:250) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.DispatcherServlet.render(DispatcherSe rvlet.java:1060) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch erServlet.java:798) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche rServlet.java:716) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame workServlet.java:647) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServl et.java:552) [spring-webmvc-3.0.0.RELEASE.jar:3.0.0.RELEASE] 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) [javaee- api-5.1.1.jar:5.1.1] 
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [javaee- api-5.1.1.jar:5.1.1] 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:290) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) [catalina-6.0.24.jar:na] 
     at org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.jav a:87) [red5.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:235) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) [catalina-6.0.24.jar:na] 
     at org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern al(CharacterEncodingFilter.java:88) [spring-web-3.0.0.jar:3.0.0.RELEASE] 
     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR equestFilter.java:76) [spring-web-3.0.0.jar:3.0.0.RELEASE] 
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:235) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:233) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:191) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica torBase.java:465) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:127) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:102) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: 555) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:109) [catalina-6.0.24.jar:na] 
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav a:298) [catalina-6.0.24.jar:na] 
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :852) [tomcat-coyote-6.0.24.jar:na] 
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce ss(Http11Protocol.java:588) [tomcat-coyote-6.0.24.jar:na] 
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48 9) [tomcat-coyote-6.0.24.jar:na] 
     at java.lang.Thread.run(Thread.java:724) [na:1.7.0_40] 
+1

經過多次嘗試,我找不到確切的解決方案。我懷疑這是因爲某些安全問題,所以它不允許我的文件在類文件中轉換。我在我的工作文件夾中找到了一些.classtmp文件,最後我手動將它們更改爲.class,它工作正常!雖然這不是一個好的解決方案,但它對我有效。 :) – 2014-09-03 05:51:42

+0

這是一個好主意,發佈這個答案,以便它可以幫助未來的遊客。它幫助了我,如果這是一個答案,我會把它提高。 – 2015-05-01 08:16:15

回答

-2

嘗試在$TOMCAT_HOME/work/localhost/catalina刪除您的應用程序文件夾以及在config文件夾,並重新啓動Tomcat。

+0

我試過但它沒有奏效。請檢查我對此的評論。順便說一句,謝謝你的回覆:) – 2014-09-03 05:52:26

+0

很高興你找到了解決方案:) – ErrorNotFoundException 2014-09-03 05:57:35

-1

經過多次嘗試,我找不到確切的解決方案。我懷疑這是因爲某些安全問題,所以它不允許我的文件在類文件中轉換。我在我的工作文件夾中找到了一些.classtmp文件,最後我手動將它們更改爲.class,它工作正常!雖然這不是一個好的解決方案,但它對我有效。 :)