Tomcat, tempdir

Tagged:  

Finally found the cause of the problem I was having with Tomcat, and it was a bitch to find. Basically, I was missing a directory named "temp" in the CATALINA_BASE directory. Usually this is caused by unzipping the Tomcat distribution with an unzipper which doesn't create empty directories, which apparently WinZip doesn't. This actually wasn't my case, I'm building the web site home with Ant, but my source copy of the website didn't have the temp directory, so it was the same problem.

Searching on the exceptions involved turned up lots of irrelevant stuff, but I finally turned up a thread on the Tomcat-Users mailing list which tipped me off. For the record (and Google), here's the stack trace I was getting:

2002-09-03 14:40:59 ContextConfig[/docs]: Scanning JAR at resource path \n '/WEB-INF/lib/neat_friends.jar'
2002-09-03 14:40:59 ContextConfig[/docs] Exception processing JAR at \n resource path /WEB-INF/lib/neat_friends.jar
javax.servlet.ServletException: Exception processing JAR at resource path \n /WEB-INF/lib/neat_friends.jar \n at org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:936)
...

----- Root Cause -----
java.io.IOException: The system cannot find the path specified
at java.io.Win32FileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1162)
at java.io.File.createTempFile(File.java:1247)
at java.io.File.createTempFile(File.java:1284)
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:143)
...

Keywords: Tomcat 4, scanning jar, jar file does exist! WTF!?!?