• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.util.zip.ZipException: invalid entry size

 
Sean Sullivan
Ranch Hand
Posts: 427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using java.util.zip.ZipInputStream to read the contents of a EAR.
The EAR contains a WAR
The WAR contains JAR files in WEB-INF/lib
My application tries to read the contents of the a JAR that is inside
the WAR.
The code is throwing 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:159)
at zipdiff.DifferenceCalculator.buildZipEntryMap(DifferenceCalculator.java:125)
at zipdiff.DifferenceCalculator.calculateDifferences(DifferenceCalculator.java:230)
at zipdiff.DifferenceCalculator.getDifferences(DifferenceCalculator.java:309)
at zipdiff.DifferenceCalculator.main(DifferenceCalculator.java:332)
What would cause this?
I am using Sun JDK 1.4.1_05 on Windows 2000
 
Sean Sullivan
Ranch Hand
Posts: 427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured out the root cause of the "java.util.zip.ZipException: invalid entry size".
My application uses recursion to scan through all nested ZIP files.
There was a bug in my recursion logic. I was passing an incorrect InputStream instance to one of the methods in my application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!