You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stuart Piltch <st...@gradientblue.com> on 2005/06/23 16:40:56 UTC

Solution for "Error creating temporary file" problem (5.0.x)

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