Fiji won't start after adding an update site (FilamentDetector)

filaments
scijava
java
Tags: #<Tag:0x00007fb87d7decd0> #<Tag:0x00007fb87d7deb68> #<Tag:0x00007fb87d7dea28>

#1

Hey there, I’ve been running up to date Fiji on Kubuntu 18.4 with OpenJDK 1.8. After adding FilamentDetector update site my Fiji will not start and gives the following errors related to SciJava Service.

Any ideas how I can fix this other than re-downloading Fiji? I don’t see any obvious access to the update site list without being unable to start the program.

Thanks, David

user@host:~$ Fiji.app/ImageJ-linux64
OpenJDK 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

(ImageJ-linux64:18296): Gtk-WARNING **: 18:43:33.232: Unable to locate theme engine in module_path: "adwaita",

(ImageJ-linux64:18296): Gtk-WARNING **: 18:43:33.234: Unable to locate theme engine in module_path: "adwaita",
Error while executing the main() method of class 'net.imagej.Main':
java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService
        at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:281)
        at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
        at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:195)
        at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:167)
        at org.scijava.Context.<init>(Context.java:280)
        at org.scijava.Context.<init>(Context.java:236)
        at org.scijava.Context.<init>(Context.java:176)
        at org.scijava.Context.<init>(Context.java:162)
        at net.imagej.ImageJ.<init>(ImageJ.java:77)
        at net.imagej.Main.main(Main.java:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:279)
        at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:186)
        at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)
Caused by: java.lang.NullPointerException
        at java.util.ArrayList.addAll(ArrayList.java:581)
        at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:464)
        at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:434)
        at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:317)
        at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:270)
        ... 16 more

#2

The FilamentDetector update site ships a few outdated jar files that shade newer versions distributed by the Java-8 update site.

I invited the maintainer of the update site, @hadim, to this topic, since I think this can only be fixed by stopping to ship those offending jar files, now that the required versions are shipped by the core update site.


#3

I think @imagejan is right. I’ll have a look today.


#4

@david.bragason Sorry for the trouble trying to use the plugin.

I realized that it was shipping with some SNAPSHOT package (imagej-ops) and it should not… Moreover, I remove a pretty big dependency (nd4j) that I was using for only a very small part of the plugin (the nucleation analyzer). I plan to rewrite this part without that dependency.

I released a new version 0.4.2 and just tested the plugin on a fresh Fiji installation and everything seems to work so far.

@imagejan: I discovered the removed dependencies are automatically removed (at least not downloaded during installation) from the update site. I didn’t know that behavior and it’s a nice one!

@imagejan Any idea why things such as ij, imagej or imagej-legacy are uploaded to the update site: https://travis-ci.org/hadim/FilamentDetector/builds/367236986#L1279. It does not seem to affect the fresh Fiji installation I did the test on but it’s probably not a very good practice. Here is the script used to upload release via Travis: https://raw.githubusercontent.com/hadim/fiji/update-site/bin/upload-update-site.sh


#5

@imagejan, @ctrueden: A question about best practices for plugins that are shipped via update sites.

Should I stick the version of pom-scijava to the one declared in the pom.xml of Fiji and update it whenever Fiji update it so I am sure to work with the same version and dependencies of the Fiji installation where the plugin are going to be installed? If yes, is there is a Maven way to automatically set the Scijava version of the version used by the last Fiji release?


#6

Thank you very much for your prompt attention @hadim ! I look forward to testing out the plugin.

However, I’m still getting the same error with 0.4.2 installed into fresh Fiji:

david@whitey:~/Fiji.app/jars$ ll FilamentDetector-0.4.2.jar 
-rw-rw-r-- 1 david david 1614457 apr 16 16:42 FilamentDetector-0.4.2.jar
david@whitey:~/Fiji.app/jars$ cd ..
david@whitey:~/Fiji.app$ ./ImageJ-linux64 
OpenJDK 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
Error while executing the main() method of class 'net.imagej.Main':
java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService
        at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:281)
        at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
        at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:195)
        at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:167)
        at org.scijava.Context.<init>(Context.java:280)
        at org.scijava.Context.<init>(Context.java:236)
        at org.scijava.Context.<init>(Context.java:176)
        at org.scijava.Context.<init>(Context.java:162)
        at net.imagej.ImageJ.<init>(ImageJ.java:77)
        at net.imagej.Main.main(Main.java:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:279)
        at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:186)
        at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)
Caused by: java.lang.NullPointerException
        at java.util.ArrayList.addAll(ArrayList.java:581)
        at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:464)
        at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:434)
        at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:317)
        at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:270)
        ... 16 more

#7

Can you try to do it from a fresh Fiji installation?

If you are still using the old one you might still have all the deps I have removed.


#8

It was a freshly expanded fiji-nojre.zip and there are no update sites enabled apart from the default ones plus FilamentDetector. I tried it again with the same result.


#9

Is there is any reason you’re using the nojre version? Ubuntu Java version does not contain JavaFX which is the library I use to build the graphical interface of the plugin.

Try to use the Fiji package that ship Java: https://downloads.imagej.net/fiji/latest/fiji-linux64.zip


#10

You nailed it - my system had no JavaFX. Using the bundled JRE as you suggested fixes this, or simply installing the package openjfx make everything work with the no-JRE version as well.

Thanks a lot!


#11

Awesome. Let me know how it goes with FilamentDetector.


#12

That is certainly a safe way to go. Then you won’t accidentally shadow core libraries by using a “too new” version of the BOM.

Not a Maven way, that I know of. It might work to use import scope with the sc.fiji:fiji artifact in your <dependencyManagement>.

But may be easier to use a one-liner like:

curl -fsL 'http://maven.imagej.net/service/local/artifact/maven/redirect?r=releases&g=sc.fiji&a=fiji&v=RELEASE&e=pom' | grep '<version>' | head -n1 | sed 's/.*>\(.*\)<.*/\1/'

?