我正在将一个带有JSP页面的应用程序从Weblogic服务器移动到Tomcat,并且在执行此操作时面临以下错误。我创建了一个war文件,在tomcat上部署并将其放在tomcat的webapps文件夹中,然后运行bin/startup.sh
脚本在tomcat服务器上部署war文件。但是,当我查看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)
(...)
答案 0 :(得分:2)
确保用户在启动tomcat服务器的以下文件夹中具有写入权限。
/opt/mw/tomcat/ssloyalty-qa/ssloyalty-gui/work/Catalina/localhost/