我正在将带有 JSP 页面的应用程序从 Weblogic 服务器移动到 Tomcat,并且在执行此操作时遇到以下错误。我创建了一个war文件以部署在tomcat上,并将其放在tomcat的webapps文件夹中,然后运行bin/startup.sh
脚本将war文件部署到tomcat服务器上。但是,当我查看 tomcat 目录下的工作文件夹时,它是空的,并且没有 /opt/mw/tomcat/ssloyalty-qa/ssloyalty-gui/work/Catalina/localhost/traveler/org/apache/jsp/pages/programs_jsp.java (Permission denied)
错误中提到的文件。我的应用程序中很少有 JSP 页面可以正确显示而没有任何错误。他们中只有少数人抛出下面给出的这个错误。
Exception:
org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:604)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
(...)
Caused by:
java.io.FileNotFoundException: /opt/mw/tomcat/ssloyalty-qa/ssloyalty-gui/work/Catalina/localhost/traveler/org/apache/jsp/pages/programs_jsp.java (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:194)
at java.io.FileOutputStream.(FileOutputStream.java:84)
at org.apache.jasper.compiler.Compiler.setupContextWriter(Compiler.java:298)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:230)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
(...)