ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sullivan, Sean C - MWT" <Sullivan.S...@menlolog.com>
Subject RE: EAR (zip) files created using Ant
Date Mon, 12 Apr 2004 04:43:46 GMT
I figured out the root cause of the "java.util.zip.ZipException: invalid entry size".

There was a bug in the recursion logic in my program. 

I was passing an incorrect InputStream instance to one of the methods in my application. 

The bug was solely in my code. 

-Sean

p.s. - I found 3 Java implementations of ZipOutputStream

1) java.util.zip.ZipOutputStream
2) org.apache.tools.zip.ZipOutputStream (used by Ant)
3) org.apache.commons.compress.zip.ZipOutputStream  
   (Jakarta Commons Compress project)


-----Original Message-----
From: Sullivan, Sean C - MWT
To: user@ant.apache.org
Sent: 4/9/2004 9:58 AM
Subject: EAR (zip) files created using Ant


I am using Ant's <ear> task to create an EAR file.

The EAR file contains a single WAR:  foo.war

foo.war contains a JAR file:   WEB-INF/lib/wsdl4j.jar


I wrote a Java program that will read the contents of the EAR file.
The program recursively scans the contents of all nested 
WAR files, ZIP files, and JAR files.

The program uses java.util.zip.ZipInputStream and java.util.zip.ZipEntry

While reading from the ZipInputStream, the program throws 
a ZipException:


Exception in thread "main" java.util.zip.ZipException: invalid entry
size (expected 736810 but got 736719 bytes)
at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:362)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:91)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:69)
at
zipdiff.DifferenceCalculator.processEmbeddedZipFile(DifferenceCalculator
.java:182)
at
zipdiff.DifferenceCalculator.processZipEntry(DifferenceCalculator.java:1
59)
at
zipdiff.DifferenceCalculator.buildZipEntryMap(DifferenceCalculator.java:
125)
at
zipdiff.DifferenceCalculator.calculateDifferences(DifferenceCalculator.j
ava:230)
at
zipdiff.DifferenceCalculator.getDifferences(DifferenceCalculator.java:30
9)
at zipdiff.DifferenceCalculator.main(DifferenceCalculator.java:332)


This is my question:  When Ant creates an EAR file, does it use
java.util.zip.ZipOutputStream or does it use 
org.apache.tools.zip.ZipOutputStream?

If the EAR (zip) file is created with
org.apache.tools.zip.ZipOutputStream, will I be able to read the file
using java.util.zip.ZipInputStream?

What is causing the "invalid entry size" error message?



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message