<p>I have a Jar file, which contains other nested Jars. When I invoke the new <code>JarFile()</code> constructor on this file, I get an exception which says:</p>

<blockquote>
  <p>java.util.zip.ZipException: error in opening zip file</p>
</blockquote>

<p>When I manually unzip the contents of this Jar file and zip it up again, it works fine.</p>

<p>I only see this exception on WebSphere 6.1.0.7 and higher versions. The same thing works fine on tomcat and WebLogic. </p>

<p>When I use JarInputStream instead of JarFile, I am able to read the contents of the Jar file without any exceptions.</p>

It could be related to log4j.
Do you have log4j.jar file in the websphere java classpath (as defined in the startup file) as well as the application classpath ?
If you do make sure that the log4j.jar file is in the java classpath and that it is NOT in the web-inf/lib directory of your webapp.
It can also be related with the
ant version
(may be not your case, but I do put it here for reference):
You have a .class file in your class path (i.e. not a directory or a .jar file). Starting with ant 1.6, ant will open the files in the classpath checking for manifest entries. This attempted opening will fail with the error "java.util.zip.ZipException"
The problem does not exist with ant 1.5 as it does not try to open the files. - so make sure that your classpath's do not contain .class files.
On a side note, did you consider having
separate jars
?
You could in the manifest of your main jar, refer to the other jars with this attribute:
```
```
Class-Path: one.jar two.jar three.jar
```
```
Then, place all of your jars in the same folder.
Again, may be not valid for your case, but still there for reference.