tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: war file extraction issues in tomcat 5.5
Date Wed, 11 Jul 2012 01:33:45 GMT
Hash: SHA1


On 7/10/12 2:56 AM, Rajesh Kumar wrote:
> I am finding many issues in it but still not able to resolve this.
> Is there any expert opinion on this... I have this setup in
> Cpanel.
> I have added export JAVA_OPTS="-XX:PermSize=128M
> -XX:MaxPermSize=524M" in but dint help.

As Mark Eggers says, these settings are not relevant. All comments he
makes about them are spot-on: move to, use CATALINA_OPTS,
and you probably meant -Xms and -Xmx, though some people really do
need a huge PermGen. Are you sure you're one of them?

> SEVERE: Exception fixing docBase: {0} 
> /home/surgnet/public_html/sample/META-INF/MANIFEST.MF (No such file
> or directory) at Method) at
><init>( at
><init>( at
> org.apache.catalina.startup.ExpandWar.expand(

ExpandWar.expand is trying to write to the file
/home/surgnet/public_html/sample/META-INF/MANIFEST.MF and it can't:
"No such file or directory" is a stupid exception message. What it
really means is that the parent directory
(/home/surgnet/public_html/sample/META-INF/) does not exist. Try a
simple test like this and you'll see you get the same exception message:


public class FileTest
  public static void main(String[] args)
    throws Exception
    File file = new File("./nosuchdir/a_file");
    new FileOutputStream(file);

So, the problem is that the parent directory doesn't exist. Why? Well,
ExpandWar.expand, on line 165 does this:

161	int last = name.lastIndexOf('/');
162 	if (last >= 0) {
163	 	File parent = new File(docBase,
164	 	name.substring(0, last));
165	 	parent.mkdirs();
166 	}

There is no check of the return value of parent.mkdirs(), which can
fail with no exception (part of the charm of the package:
sometimes you get an exception and sometimes you don't).

Technically, one could argue that this is a bug in Tomcat (which I
will log, though it will probably not be fixed since it isn't serious
enough to warrant a fix to a Tomcat version which is in
maintenance-mode -- that is, one that really only gets security
updates) because the return value of File.mkdirs should really be
checked for false which indicates a problem. Then, an exception could
be thrown that says "I can't create [parent dir]" and bombs, so you
don't get the stupid FileNotFoundException.

At any rate, I highly suspect that this is a file-permissions error:
can your Tomcat user write to the /home/surgnet/public_html/sample/
directory? Remember that the user will require both write *and*
execute privileges to really use a directory on a *NIX filesystem.

> SEVERE: Exception fixing docBase: {0} 
> /home/surgnet/public_html/surgeryplanet/META-INF/MANIFEST.MF (No
> such file or directory) at
> Method) at
><init>( at
><init>( at
> org.apache.catalina.startup.ExpandWar.expand( at
> org.apache.catalina.startup.ExpandWar.expand(

This is certainly the same error.

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message