user2891164
user2891164

Reputation: 1

org.apache.jasper.JasperException: Unable to compile class for JSP and java.io.FileNotFoundException: programs_jsp.java (Permission denied)

I am moving an application with JSP pages from Weblogic server to Tomcat and while doing it facing the following error. I created a war file to deploy on tomcat and placed the same in webapps folder of the tomcat and ran the bin/startup.sh script to deploy the war file on tomcat server. However when I looked at the work folder under tomcat directory it is empty and does not have the files /opt/mw/tomcat/ssloyalty-qa/ssloyalty-gui/work/Catalina/localhost/traveler/org/apache/jsp/pages/programs_jsp.java (Permission denied) mentioned in the error. There are few JSP pages in my application which are coming up correctly with out any errors. Only few of them are throwing this error given below.

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)
(...) 

Upvotes: 0

Views: 3717

Answers (1)

Shamim Ahmmed
Shamim Ahmmed

Reputation: 8383

Make sure the user has write permission in the following folder who started tomcat server.

/opt/mw/tomcat/ssloyalty-qa/ssloyalty-gui/work/Catalina/localhost/

Upvotes: 2

Related Questions