Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Archiving generated Zips are not readable

SA-45793

Summary



File listener unable to process the zip file through PRFile handle, which is created in the activity.

Error Messages



2017-09-12 17:17:22,433 [ WebContainer : 4] ( internal.archive.PRJarFile) ERROR Unable to create PRJarFile
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:140)
at java.util.jar.JarFile.<init>(JarFile.java:140)
at java.util.jar.JarFile.<init>(JarFile.java:104)
at com.pega.pegarules.deploy.internal.archive.PRJarFile.<init>(PRJarFile.java:63)
at com.pega.pegarules.deploy.internal.archive.ParUtilsImpl.getArchiveType(ParUtilsImpl.java:717)
at com.pega.pegarules.deploy.internal.PRRuleMgmtUtilsImpl.readArchive(PRRuleMgmtUtilsImpl.java:441)
at com.pega.pegarules.deploy.internal.PRRuleMgmtUtilsImpl.readArchive(PRRuleMgmtUtilsImpl.java:436)
at com.pega.pegarules.deploy.internal.PRRuleMgmtUtilsImpl.createArchiveForRead(PRRuleMgmtUtilsImpl.java:504)
at com.pega.pegarules.deploy.internal.PRRuleMgmtUtilsImpl.createArchiveForRead(PRRuleMgmtUtilsImpl.java:517)



Steps to Reproduce



1.Turn on the File listener to process the zip file.
2.Create PRFile handle in activity to access the file.



Root Cause



User created the following PRFile handle:

ClipboardPage logServiceFilePage = tools.findPage("LogServiceFile");
String renamedFileName= logServiceFilePage .getString("pyWorkFileName");
PRFile prfile = new PRFile(<FileListener_defaultlocation> +RenamedFileName);


After picking file, file service renames it and then starts processing.

Once this processing is done it copies that file to completed folder inside work_<fileListener>.

File is present in work_<listenername> but as this file was renamed, PRFile handle is not able to find it with the original name.



Resolution



As file listener renames and moves the files to work_<listenername> folder, a new name must be provided to PRFile handle.

For example file listener name is test, then PRFile handle must be created like this below:

PRFile prfile = new PRFile(file://default:/work_test+renamedFileName);
Suggest Edit

Published March 14, 2018 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us