svyUtil 1.4.1, svyIO.zip(): java.util.zip.ZipException

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

svyUtil 1.4.1, svyIO.zip(): java.util.zip.ZipException

Postby pbdavis » Fri Apr 10, 2020 7:56 pm

Switched to Servoy 2020.03 and svyUtil 1.4.1 from Servoy 2019.12.1 and svyUtil 1.3.1. Java version 1.8.0_212 x64.
I'm using svyIO.zip() to create a zip file of PDFs. In the new 1.4.1 I get the following exception:
Code: Select all
ERROR com.servoy.j2db.util.Debug - ERROR Error zipping file "C:\Servoy_Files\2020-4-9_13-47-11": java.util.zip.ZipException: no current ZIP entry
   at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:2281
   at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:2145
   at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:1353
   at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:1524
   at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:1637
   at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyIO.js:249 (zip)
   at C:\Users\pbdavis\servoy_workspace_2020.03\TIGER_9_FBM\forms\frmSearchMain.js:3309 (zipFolderDownload)
   at C:\Users\pbdavis\servoy_workspace_2020.03\TIGER_9_FBM\forms\frmSearchMain.js:3257 (searchPdfExport)
ERROR com.servoy.j2db.util.Debug - JavaException: java.util.zip.ZipException: no current ZIP entry (C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyIO.js#250) (Form Context: frmSearchMain), JSEvent(type = action, source = RuntimeScriptButton, formName = frmSearchMain, elementName = <no name>, timestamp = Thu Apr 09 13:47:11 EDT 2020,modifiers = 0,x =5,y = 6,data = null) JavaException: java.util.zip.ZipException: no current ZIP entry

   at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyIO.js:250 (zip)
   at C:\Users\pbdavis\servoy_workspace_2020.03\TIGER_9_FBM\forms\frmSearchMain.js:3309 (zipFolderDownload)
   at C:\Users\pbdavis\servoy_workspace_2020.03\TIGER_9_FBM\forms\frmSearchMain.js:3257 (searchPdfExport)


The exception occurs on the line
Code: Select all
dest.write(buffer);
the first time it is called. See below:
Code: Select all
function channelCopy(src, dest) {
   var buffer = java.nio.ByteBuffer.allocateDirect(16 * 1024);
   while (src.read(buffer) != -1) {
      // prepare the buffer to be drained
      buffer.flip();
      // write to the channel, may block
      dest.write(buffer);
      // If partial transfer, shift remainder down
      // If buffer is empty, same as doing clear()
      buffer.compact();
   }
   // EOF will leave buffer in fill state
   buffer.flip();
   // make sure the buffer is fully drained.
   while (buffer.hasRemaining()) {
      dest.write(buffer);
   }
   src.close();
}


Tested svyUtil 1.3.1 svyIO.zip() with Servoy 2020.03 and it works fine.
I could not find any requirements on java version needed.
Any idea on why this fails?
Thanks,
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: svyUtil 1.4.1, svyIO.zip(): java.util.zip.ZipException

Postby patrick » Mon Apr 13, 2020 5:03 pm

I have fixed that now in master.

Please comment out line 230 in svyIO like this:

Code: Select all
// zipOutputStream.closeEntry();


That should fix the problem until the next version is released.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3692
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: svyUtil 1.4.1, svyIO.zip(): java.util.zip.ZipException

Postby pbdavis » Wed Apr 15, 2020 7:11 pm

That worked.
Thanks,
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron