IBM Support

Routing ZIP files in File Gateway

Technote (troubleshooting)


Sterling FileGateway routing fails when files inside a ZIP file have special characters in the file name.


Sterling FileGateway file routing fails when files inside a ZIP file have special characters in their file name. Event code FG_0455 “java.lang.IllegalArgumentException”.


This is a known defect in the JDK both for Sun/Oracle and IBM JDK. The defect is resolved in JDK version 7.



Diagnosing the problem

Event code FG_0455 “java.lang.IllegalArgumentException”

ERRORDTL [1355491932088]java.lang.
at com.sterlingcommerce.fg.router.RouteIdentifier.crackOpenZip
at com.sterlingcommerce.fg.router.RouteIdentifier.getZipTOC
at com.sterlingcommerce.fg.router.RouteIdentifier.getMatches
at com.sterlingcommerce.fg.router.RouteIdentifier.
at com.sterlingcommerce.fg.router.RouteIdentifier.findRoutePlans
at com.sterlingcommerce.fg.router.ArrivedFile.determineRoutes
at com.sterlingcommerce.fg.router.ArrivedFile.startRoute(ArrivedFile.
at com.sterlingcommerce.fg.router.FileGatewayRouter.processRoute

Resolving the problem

The solution is in JDK7 with 3 new constructors:
ZipFile(File, Charset)
ZipInputStream(InputStream, Charset)
ZipOutputStream(OutputStream, Charset)

NOTE:- Running SI in JDK 7 is not yet supported.

Here are some suggestions for a workaround to help process the data:
1. Ask the sender to remove accents from the file name.

2. Using (IBM) JDK 7 with the correct OS code page set (ibm437) works OK.

Here is the API to open Zip file to read special characters.
zis = new ZipInputStream(new FileInputStream("../"), Charset.forName("ibm437"));

The workaround is to install JDK 7 separately.
Run CLA2Client adapter on the server where JDK 7 is installed.

Call CLA2Client to extract the Zip File contents using JDK 7 before passing the extracted contents to SFG for file routing.
Any other command line tool could be used to achieve the same result provided it successfully unzips the contents of the Zip file.

3. For ZIP files, there is no standard encoding, and no standard method to indicate which encoding is used. So zip tools may generally pick some platform default encoding.
If the tool used to create the ZIP file name has the same encoding as the one used to read it, then there may not be a problem. If not, there will be a problem.

Java currently expects UTF-8 encoding in dealing with zip or jar file. For SFG java code to work with a zip file either the name of the file in zip should not have non-ascii characters or the zip tool generating the zip file uses UTF-8 encoding. Jar command in java jdk can generate a zip file with UTF-8 encoding.
For example, "jar -cfM *" to generate a zip file containing the file with non-ascii characters as its name and tested SFG with the generated zip file.

Please implement one of the workarounds above in order to process the data in SI

Document information

More support for: Sterling B2B Integrator

Software version: 5.2

Operating system(s): Platform Independent

Reference #: 1621761

Modified date: 07 January 2013

Translate this page: