NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 763 - Updater problem
Updater problem
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2014-06-09 08:27 CDT by claudio.collinet
Modified: 2014-06-12 11:09 CDT
3 users (show)

See Also:

Description claudio.collinet 2014-06-09 08:27:48 CDT
Since this morning I'm having problems with the fiji updater. It first started and repeated the same download operation over and over again and once I stopped it I cannot update anymore. I get message in an updater window that says "there was a problem checking whether everything is up-to-date. Start the updater?" If I do it, I get a bootstrap.js window. I follow the instructions (i.e. run the command Evaluate Javascript) and the following log 

Error: La fonction importPackage doit être appelée avec un package et non avec "[JavaClass ij]" (<Unknown source>#1) in <Unknown source> at line number 1 

It's in french but it says that the function importPackage needs to be called with a package and not with JavaClass. 

What happened? How can I give you more details if you need them? 
Thanks 
Claudio 
P.S. I'm running imageJ 2.0.0-rc-2; Java 1.6.0_24[64-bit] on Win7

Information about your version of Java:

  os.arch => amd64
  os.name => Windows 7
  os.version => 6.1
  java.version => 1.6.0_24
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_24-b07
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 19.1-b02
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \

The up-to-date check says: imagej.updater.core.UpToDate

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: C:\Fiji.app/java/win64/jdk1.6.0_24//jre
  imagej.dir => C:\Fiji.app

Information about the version of each plugin:

imagej.updater.core.FilesCollection
Comment 1 Johannes Schindelin 2014-06-09 14:28:39 CDT
Typically, the problem just goes away if you cancel the update (there is a cancel button in the progress window), quit Fiji and restart it.

That is just a work-around, of course, while I am busy trying to fix things.
Comment 2 Johannes Schindelin 2014-06-09 14:54:39 CDT
Found the problem, hold on while I clean up the code to fix it properly.
Comment 3 Johannes Schindelin 2014-06-09 16:41:38 CDT
Unfortunately, the problem is more dramatic than I initially thought. So I fixed it, but of course the fix is only in the *new* version!

That means that you will have to cancel the infinite updating loop, restart Fiji, and update again. That should repair your updater.

Very sorry for the breakage!
Comment 4 claudio.collinet 2014-06-10 03:40:28 CDT
Hi Johannes and all the others,
unfortunately the solution you propose doesn't work for me. Since the first time I canceled the loop I can't launch the updater anymore.. As I wrote in my first post (see below) when I restart FIJI or if run the command 'Update FIJI' from the Help menu I get the bootstrap.js macro but this is the end won't work (see below).

from first post [...] "I get message in an updater window that says "there was a problem checking whether everything is up-to-date. Start the updater?" If I do it, I get a bootstrap.js window. I follow the instructions (i.e. run the command Evaluate Javascript) and the following log 

Error: La fonction importPackage doit être appelée avec un package et non avec "[JavaClass ij]" (<Unknown source>#1) in <Unknown source> at line number 1 

It's in french but it says that the function importPackage needs to be called with a package and not with JavaClass." [...]

What should I do to repair the updater? I wouldn't like to have to re-install everything.
Thanks a lot for your help!
Claudio
Comment 5 Mark Hiner 2014-06-10 07:44:07 CDT
Hi Claudio,

 Sorry I misunderstood your original message.. I thought that Fiji was asking if you wanted to update and that's what was causing bootstrap.js to pop up. I didn't realize it also pops up when you run Help > Update Fiji manually.

 Could you try updating from the command line? The wiki page (fiji.sc/Update_Fiji) explains how to do so.. basically you just want to run "imagej-winXX.exe --update update" and it should run the updater.

 If that doesn't work, the update site is hosted on the Fiji wiki itself (http://fiji.sc/update/). You should be able to manually download the updated .jars... but Johannes needs to chime in here, as I'm not sure which dependencies you need to update.

 Also, Johannes, I got the infinite updater bug this morning again.. :( maybe because I was downloading the fix? It worked for me to cancel and restart Fiji.
Comment 6 claudio.collinet 2014-06-10 11:25:06 CDT
Hi Mark,
I tried to run the updater from the command prompt as you suggested but nothing happens.. Since I hav never used FIJI through the command line I may have done something wrong. Here is what I did exactly:
- in the command prompt I navigate into the folder where I have executable fiji or imagej-win64 files
- then I run the "imagej-win64.exe --update update" command as you suggested, but nothing happens.
How should I proceed? What can I do to repair the problem?

Thanks a lot!
Claudio
Comment 7 Mark Hiner 2014-06-10 12:07:35 CDT
Hi Claudio,

 What you did sounds exactly right.. as far as I can tell, no message means everything is up to date. It will only update things that would have been marked for update in the updater though...

 Johannes - which are the relevant jars that need to be updated?
Comment 8 claudio.collinet 2014-06-10 12:11:34 CDT
Hi Mark,
as a matter of fact when I restart FIJI I get exactly the same problem as before trying the update from the command line. It looks as there was nothing to update and nothing has been updated...
Claudio
Comment 9 Mark Hiner 2014-06-10 14:45:57 CDT
Hi Claudio,

 It looks like there are some bugs with the ImageJ launcher on Windows. So try running:

"imagej-win64.exe --debug --update update"

instead. There were some recent changes to logging and it looks like they broke things on Windows at least, so behavior of the updater actually changes when --debug is specified.

This should tell you which jars need to be updated, but unfortunately I wasn't able to get them to actually update due to a problem harvesting command-line input. We'll get that fixed, but in the mean time you should be able to run this and least report back which jars it said needed output.

Let me know how that goes!

P.S. the new launcher tickets are:
https://github.com/imagej/imagej-launcher/issues/9
https://github.com/imagej/imagej-launcher/issues/10
https://github.com/imagej/imagej-launcher/issues/11
Comment 10 Johannes Schindelin 2014-06-10 17:55:19 CDT
Hmm. This is really strange, in particular the error:

> Error: La fonction importPackage doit être appelée avec un package et non avec "[JavaClass ij]" (<Unknown source>#1) in <Unknown source> at line number 1 

We never call importPackage at all, only importClass. In fact, I would never call importPackage anyway because those wildcard imports cause way more trouble than the people who like them so much would like to admit.

Claudio, to get you back to a working state, I would like to suggest the following: import the bootstrap.js yourself by calling File>Import>URL... and typing http://update.imagej.net/bootstrap.js as URL. This should open the macro editor with the script that you should be able to call with Ctrl+J. If you still experience the problem with "importPackage", may I ask you to use the Fiji Package Maker via Plugins>Utilities>Make Fiji Package to make a .zip and upload it via Help>Upload Sample Image? I will try to fix this as soon as possible!
Comment 11 claudio.collinet 2014-06-11 04:20:16 CDT
Hi Johannes,
firstly let me say thank you for spending so much of your time trying to fix this problem. Secondly, I tried to import the bootstrap.js by calling File>Import>URL... but I get the same problem as before. Finally, I tryied to use the Fiji Package Maker via Plugins>Utilities>Make Fiji Package to make a .zip but this also didn't want to work.. I get the following message appearing:

(Fiji Is Just) ImageJ 2.0.0-rc-2; Java 1.6.0_24 [64-bit]; Windows 7 6.1; 32MB of 20000MB (<1%)
 
java.lang.NoClassDefFoundError: Could not initialize class fiji.packaging.ZipPackager
	at fiji.packaging.Package_Maker.run(Package_Maker.java:18)
	at ij.IJ.runUserPlugIn(IJ.java:201)
	at ij.IJ.runPlugIn(IJ.java:165)
	at ij.Executer.runCommand(Executer.java:131)
	at ij.Executer.run(Executer.java:64)
	at java.lang.Thread.run(Thread.java:662)

I hope this helps to find the problem. It looks like everything we try gives no results...
Best
Claudio
Comment 12 claudio.collinet 2014-06-11 04:26:27 CDT
Hi Mark,
as yuo suggested I tried to launch the updated from the command line using the debug version. Here is the message I get in the command line I hope it helps to find out what the problem is.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\collinet>cd/d c:\fiji.app

c:\Fiji.app>imagej-win64.exe --debug --update update

c:\Fiji.app>JRE not found in 'c:\Fiji.app/jre'
JAVA_HOME contains a JRE: 'c:\Fiji.app/java/win64/jdk1.6.0_24//jre'
javaw -Xmx20000m -Dpatch.ij1=false -Dpython.cachedir.skip=true -Dplugins.dir=c:\
\Fiji.app -Xincgc -XX:PermSize=128m -Djava.class.path=c:\\Fiji.app/jars/imagej-l
auncher-3.1.0.jar -Dimagej.dir=c:\\Fiji.app -Dij.dir=c:\\Fiji.app -Dfiji.dir=c:\
\Fiji.app -Dfiji.defaultLibPath=bin/server/jvm.dll -Dfiji.executable=c:\\Fiji.ap
p\\ImageJ-win64.exe -Dij.executable=c:\\Fiji.app\\ImageJ-win64.exe -Djava.librar
y.path=c:\\Fiji.app/lib/win64;c:\\Fiji.app/mm/win64 -Dsun.java2d.noddraw=true -D
ij.debug=true -Dscijava.log.level=debug net.imagej.launcher.ClassLauncher -class
path . -ijjarpath jars -ijjarpath plugins net.imagej.updater.CommandLine update
Using JAVA_HOME c:\Fiji.app/java/win64/jdk1.6.0_24//jre
Opening Java library c:\Fiji.app/java/win64/jdk1.6.0_24//jre/bin/server/jvm.dll
Adding option: -Djava.home=c:\Fiji.app/java/win64/jdk1.6.0_24/
ij1.plugin.dirs: null
$HOME/.plugins: C:\Users\collinet\.plugins does not exist
Launching main class net.imagej.updater.CommandLine with parameters [update]
Class loader = sun.misc.Launcher$AppClassLoader@3326b249
java.lang.ClassNotFoundException: net.imagej.updater.CommandLine
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:231)
        at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:184)
        at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:76)
java.lang.ClassNotFoundException: imagej.updater.CommandLine
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:237)
        at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:184)
        at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:76)
Class 'net.imagej.updater.CommandLine' was not found
Comment 13 Johannes Schindelin 2014-06-11 08:46:19 CDT
Oh wow.

Last resort: can you just zip up your Fiji.app with any archiver you have handy (I usually recommend 7-Zip) and upload it with Help>Upload Sample File or share it in any other convenient way? I really would like to have a look at the current situation...
Comment 14 claudio.collinet 2014-06-11 09:08:58 CDT
Hi Johannes,
I uploaded my fiji.app as .rar just now. Let me know if you received it.
Claudio
Comment 15 Johannes Schindelin 2014-06-11 11:19:22 CDT
I got the .rar, and with that Fiji I can reproduce both problems!

Will keep you posted.
Comment 16 Johannes Schindelin 2014-06-11 14:02:58 CDT
The 'importPackage' problem you reported is caused by ImageJ 1.x prefixing Javascript scripts with a line that actually fails.

So I put in a couple more levels of fallbacks into the fallback Javascript, and with the Fiji.app you gave me, I can get it into a working shape again: it opens the Javascript and Ctrl+J lets it run the remote updater correctly.

Could you please verify that my fix works on your side of the Atlantic, too?

Thank you very much.
Comment 17 Johannes Schindelin 2014-06-11 14:10:21 CDT
For Curtis: the diff is here: https://github.com/fiji/fiji/commit/bc7da8b6ea70bf6840be0c0d1fa7bdfcbf7c2203
Comment 18 claudio.collinet 2014-06-12 11:02:56 CDT
Hi Johannes,
it works also on the other side of the Atlantic! And now I can also read the very useful welcome message.
Thank you so much for your efforts!
All the best
Claudio
Comment 19 Johannes Schindelin 2014-06-12 11:09:34 CDT
Great! I'll close this bug, then. Thank you for your patience with me, I think in the end Fiji became much more robust as a consequence!