tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Piltch <stu...@gradientblue.com>
Subject Solution for "Error creating temporary file" problem (5.0.x)
Date Thu, 23 Jun 2005 14:40:56 GMT
Hi there,

I just spent a bit too much time tracking this one down, so I thought I'd share
my results for the next person searching this list.


The symptom 
----------- 
Error creating temporary file at
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.
executeExternalCompile(DefaultCompilerAdapter.java:426)

...

java.io.FileNotFoundException: /files719319651 (Permission denied) at
java.io.FileOutputStream.open(Native Method)


The reason 
----------
In tomcat 5.0.X, ant is being used to compile jsps to class files. If the java
classpath is more than 4k (for me, this happened when adding one more jar
to common/lib/), ant will use a temporary file while compiling. 

Ant 1.6.2 and before used "user.dir" to find the location for this. This was 
fixed in Ant 1.6.3 to use "java.io.tmp" (which is correctly set by tomcat)

Since tomcat 5.0.28 uses ant 1.6.1 and 5.0.30-beta uses ant 1.6.2, you'll 
get the above error if:
 - you're using tomcat 5.0.30-beta or earlier
 - you have a lot of jars
 - you don't run tomcat as root
 - you launch tomcat through a script that doesn't set user.dir
 

The solution
------------
The quick fix is to change your launch script to include something like this:

    EXPORT CATALINA_OPTS='-Duser.dir=/tmp'

(or some other appropriate temp directory) before calling 
$CATALINA_HOME/bin/startup.sh


The real fix
------------
Tomcat 5.0.X should probably be updated to use a more recent version of the 
ant.jar


Hope this helps someone else at some point.


Cheers,

 - stuart


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message