DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20527>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20527

solution to Unable to compile class for JSP

           Summary: solution to Unable to compile class for JSP
           Product: Tomcat 4
           Version: 4.1.24
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Several users have encountered this jsp error, One possible cause is
if a temp file cannot be written to the current directory.

Symptom:

HTTP Status 500 - Internal Server Error

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server
Error) that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
 [javac] Since fork is true, ignoring compiler setting.
 [javac] Compiling 1 source file
 [javac] Since fork is true, ignoring compiler setting.
  
  at
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
  at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
  at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
  at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[...]

Apache Tomcat/4.1.24

--------------------
in catalina.out found this:

Error creating temporary file
        at
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(Def
aultCompilerAdapter.java:433)
        at
org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:81)
[etc etc]
Caused by: java.io.FileNotFoundException:
/usr/apache/jakarta-tomcat-4.1.24/files-1650139464 (Perm
ission denied)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at java.io.FileWriter.<init>(FileWriter.java:73)
        at
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(Def
aultCompilerAdapter.java:424)
        ... 38 more
--- Nested Exception ---
java.io.FileNotFoundException:
/usr/apache/jakarta-tomcat-4.1.24/files-1650139464 (Permission deni
ed)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at java.io.FileWriter.<init>(FileWriter.java:73)
        at
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(Def
aultCompilerAdapter.java:424)
--------------------
Looking at the source of ant 1.5.1,
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.java
It does this:
   String userDirName = System.getProperty("user.dir");
   File userDir = new File(userDirName);
   tmpFile = fileUtils.createTempFile("files", "", userDir);
   out = new PrintWriter(new FileWriter(tmpFile));

Looks like ant wants to write to user.dir. What's that?
"The system property user.dir contains the current user directory."
Hmm. I like ${CATALINA_HOME} read only.
--------------------
I start tomcat using "${CATALINA_HOME}/bin/catalina.sh start", so
adding 
CATALINA_OPTS='-Duser.dir=/an/appropriate/temp/directory'
export CATALINA_OPTS
is a workaround.

-- 
nord

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to