Zip file is unreadable. Cause: java.util.zip.ZipException: invalid entry size
Technote (troubleshooting)
Problem(Abstract)
A zip file is received to be routed and unzipped by the routing template in Sterling Filegateway(SFG) and it fails to route with:
FG_0455 Zip file is unreadable. Cause: java.util.zip.ZipException: invalid entry size.
This mainly happens with larger files (larger than 4GB) but it can also happen with smaller zip files if the file format is ZIP64.
This could also occur when using the compression service in a business process.
Symptom
File is not routed and the following error is in filegateway.log
[2015-02-12 13:02:13.955] ERROR Arrived File Failed
[2015-02-12 13:02:13.955] ERROR [1423764133955] Zip file is unreadable. Cause: java.util.zip.ZipException: invalid entry size (expected 778774528 but got 5073741824 bytes).
[2015-02-12 13:02:13.955] ERRORDTL [1423764133955]com.sterlingcommerce.fg.exception.FileGatewayRouteException: Zip file is unreadable. Cause: java.util.zip.ZipException: invalid entry size (expected 778774528 but got 5073741824 bytes).
at com.sterlingcommerce.fg.exception.FileGatewayRouteException.newZipUnreadable(FileGatewayRouteException.java:51)
at com.sterlingcommerce.fg.router.RouteIdentifier.extractZipEntry(RouteIdentifier.java:665)
at com.sterlingcommerce.fg.router.RouteIdentifier.crackOpenZip(RouteIdentifier.java:630)
at com.sterlingcommerce.fg.router.RouteIdentifier.getZipTOC(RouteIdentifier.java:601)
at com.sterlingcommerce.fg.router.RouteIdentifier.getMatches(RouteIdentifier.java:512)
at com.sterlingcommerce.fg.router.RouteIdentifier.findRoutePlansForChannel(RouteIdentifier.java:227)
at com.sterlingcommerce.fg.router.RouteIdentifier.findRoutePlans(RouteIdentifier.java:163)
at com.sterlingcommerce.fg.router.ArrivedFile.determineRoutes(ArrivedFile.java:544)
at com.sterlingcommerce.fg.router.ArrivedFile.startRoute(ArrivedFile.java:211)
at com.sterlingcommerce.fg.router.FileGatewayRouter.processRoute(FileGatewayRouter.java:136)
at com.sterlingcommerce.fg.services.FileGatewayRouteService.primitiveProcessData(FileGatewayRouteService.java:76)
at com.sterlingcommerce.fg.services.TransformingRouterService.processData(TransformingRouterService.java:79)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.invokeService(ActivityEngineHelper.java:1818)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.nextMainLogic(ActivityEngineHelper.java:631)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.next(ActivityEngineHelper.java:362)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.doWork(WorkFlowQueueListener.java:442)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.run(WorkFlowQueueListener.java:236)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.onMessage(WorkFlowQueueListener.java:197)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.onMessage(WorkFlowQueueListener.java:184)
at com.sterlingcommerce.woodstock.workflow.queue.wfTransporter.run(wfTransporter.java:444)
at com.sterlingcommerce.woodstock.workflow.queue.BasicExecutor$Worker.run(BasicExecutor.java:508)
at java.lang.Thread.run(Thread.java:804)
Caused by: java.util.zip.ZipException: invalid entry size (expected 778774528 but got 5073741824 bytes)
at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:414)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:206)
at java.io.FilterInputStream.read(FilterInputStream.java:118)
at com.sterlingcommerce.fg.router.RouteIdentifier.extractZipEntry(RouteIdentifier.java:656)
... 20 more
Cause
This has to do with the file format being ZIP64 which is currently not supported in any of the java.util.Zip classes.
The maximum file size made possible by the original, open source Zip file specification was 4 gigabytes. This limit applied both to the uncompressed and compressed sizes of files inside Zip files (.zip or .zipx), and also to the total size of a Zip file itself.
To work around this, the ZIP64 extensions were introduced - but there has not been support for ZIP64 in the Java Zip classes.
If smaller than 4GB files run into this issue, then it is possible that the file format used by the compression client may still be using ZIP64 explicitly.
Diagnosing the problem
Analyze the file format of the zip file being unzipped in SI/SFG. If it is ZIP64 (or larger than 4GB) then this is the limitation within the JDK.
Resolving the problem
Customers are advised to use the Command Line Adapter 2 to run an external program that supports the ZIP64 extensions (e.g., on Windows the latest version of WinZip supports ZIP64) to decompress the files.
http://www-01.ibm.com/support/docview.wss?uid=swg21698692