http://markmail.org/message/fvyxksx7muk3icr4 o.a.c.startup.ExpandWar.expand() calls File.mkdirs on line 165 and does not check the return value. If the call fails, a subsequent attempt to create a new FileOutputStream for a file in the (failed-to-create) directory results in a FileNotFoundException with the whole filename as the message. Here is an example from the above tomcat-user original post: SEVERE: Exception fixing docBase: {0} java.io.FileNotFoundException: /home/surgnet/public_html/sample/META-INF/MANIFEST.MF (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:194) at java.io.FileOutputStream.<init>(FileOutputStream.java:145) at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:457) at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:173) This is confusing to users because the real issue has been hidden: the inability to create the parent directory for the file. The analogous code in the current trunk is: if (!parent.mkdirs() && !parent.isDirectory()) { throw new IOException( sm.getString("expandWar.createFailed", parent)); } I believe this is the correct approach, which should be adopted for Tomcat 5.5.
Created attachment 29045 [details] Patch against current 5.5.x trunk (r1359975)
This bug exists in Tomcat 6.0.x, so I'm re-assigning since it's a bit more relevant. The fix can be thought of as a back-port, then, I guess.
Created attachment 29050 [details] Patch for 6.0.x against r1359053
Comment on attachment 29045 [details] Patch against current 5.5.x trunk (r1359975) Patch is obsolete: patch proposed for 6.0.x.
Fixed in 6.0.x. Will be included in 6.0.36.
Created attachment 29212 [details] 2012-08-11_tc55_53531.patch Patch for Tomcat 5.5. Includes a fix for missing message argument in ContextConfig.init(). That is where the thrown IOException is caught and logged.
Fixed in 5.5.x and will be included in 5.5.36 onwards.