This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 11 - Pages: 1 - Last Post: 12-May-2020 21:56 Last Post By: RobM Threads: [ Previous | Next ]
AndreWolff

Posts: 1,697
Registered: 14-Dec-2007
RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 10-May-2020 04:25
 
  Click to reply to this thread Reply
Attachment Upload error.JPG (31.4 KB)
With jAlbum 20.0.6 under Windows 10, I get sometimes this crash message:
Make changes
Make album: 1m 42.065002s
All workers shut down
Album upload: 5.417s
Total upload: 6.63s
Exception in thread "Upload thread" java.lang.RuntimeException: java.lang.ArithmeticException: / by zero
	at se.datadosen.jalbum.RemoteFSWorkers.executeNow(RemoteFSWorkers.java:158)
	at se.datadosen.jalbum.RemoteFSWorkers.executeNow(RemoteFSWorkers.java:202)
	at se.datadosen.jalbum.UploadBean.doUploadFiles(UploadBean.java:170)
	at se.datadosen.jalbum.UploadBean.uploadAlbum(UploadBean.java:737)
	at se.datadosen.jalbum.JPublishWizard$PublishStep$19.run(JPublishWizard.java:2045)
Caused by: java.lang.ArithmeticException: / by zero
	at se.datadosen.jalbum.JTransferProgressDialog.updateProgressBar(JTransferProgressDialog.java:188)
	at se.datadosen.jalbum.JTransferProgressDialog.fileProcessingProgress(JTransferProgressDialog.java:158)
	at se.datadosen.jalbum.UploadBean.fireFileProcessingProgress(UploadBean.java:1123)
It is was reproducable in a new upload command, but that next upload did take a lot of time, see screenshot.
After a new Make album followed by an upload there was no crash, but after a 2nd upload the crash was again there. Also after a 3th upload.

Edit:

I can reproduce this error with other albums as well:
Click Make followed by an Upload: no problem.
Click the upload button again: Crash.

Edited by: AndreWolff on 10-May-2020 09:35
davidekholm

Posts: 3,192
Registered: 18-Oct-2002
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 10-May-2020 11:09   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Thanks for reporting. It's triggered by attempting to upload an album when there are no changes at all to be uploaded (it divides the progress by the total byte sum). I've fixed this now in the next beta
jGromit

Posts: 6,825
Registered: 31-Jan-2006
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 10-May-2020 15:13   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Thanks for reporting. It's triggered by attempting to upload an album when there are no changes at all to be uploaded (it divides the progress by the total byte sum). I've fixed this now in the next beta

I can trigger this by starting a new project, not adding any objects, and clicking Make Album. Same problem, of course - the progress indicator routine gets tripped up by it. I had seen this earlier, but forgotten about it, since the situation was so unusual. I'm still seeing the "divide by zero" error in b9. ETA: And in b13.

To be clear, however, this isn't a "crash." Everything works properly. It just produces a console error message.

Edited by: jGromit on 12-May-2020 09:20
AndreWolff

Posts: 1,697
Registered: 14-Dec-2007
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 15:16   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
I've fixed this now in the next beta
Well I was using 20.0.6 and tried to install the latest Beta version via Tools / External Tools / jAlbum beta core update, but I got this error message:
bsh.UtilEvalError: Illegal use of undefined object or 'void' literal in jAlbum core Beta update.bsh at line number 112
.
davidekholm

Posts: 3,192
Registered: 18-Oct-2002
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 18:54   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Sorry, I have no clue what caused that.
AndreWolff

Posts: 1,697
Registered: 14-Dec-2007
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 19:09   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Sorry, I have no clue what caused that.
Well you can see the contents of line 112, I can’t, so I have to wait for the released version before I can check the solution.
jGromit

Posts: 6,825
Registered: 31-Jan-2006
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 19:13   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
Well you can see the contents of line 112, I can’t....

Why can't you? The tool is just a BeanShell text file, sitting in your config directory.

I'm guessing it's a simple permission problem.
RobM

Posts: 3,165
Registered: 4-Aug-2006
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 20:11   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Andre try the attached updated file, see if it works now.

Edited by: RobM on 12-May-2020 20:10
Deleted duff file
jGromit

Posts: 6,825
Registered: 31-Jan-2006
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 20:33   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
It doesn't like the new version, I'm afraid:
bsh.TokenMgrError: Lexical error at line 92, column 8.  Encountered: "\u201c" (8220), after : "" in jAlbum core Beta update.bsh at line number 87
The msg2 definition appears to be the culprit.
RobM

Posts: 3,165
Registered: 4-Aug-2006
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 21:23   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Try this one instead. I have changed the code so that if the core file and/ or the texts file is missing from the server it just updates the one it finds or reports no updates available. So using it now means reading the message and if a core update is expected but not reported then run the tool again.

The only thing that I could trigger Andre's error was by changing the code to look for a file that doesn't exist on the server. My conclusion is Andre was unlucky in trying to do an update when David was updating the file on the server - I assume that is possible.
jGromit

Posts: 6,825
Registered: 31-Jan-2006
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 21:52   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
That's better. The last version had a "typographic" quote mark in it, probably pasted from a non-simple text editor.
RobM

Posts: 3,165
Registered: 4-Aug-2006
Re: RuntimeException: java.lang.ArithmeticException: / by zero
Posted: 12-May-2020 21:56   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
That's better. The last version had a "typographic" quote mark in it, probably pasted from a non-simple text editor.
Thanks, I’ll update the tools post later tonight.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums