Fiji August 2020 update broke MoBIE

Posting also to let people know that a related plug-in, MoBIE (PlatyBrowser) also broke after the August 2020 update, likely because it uses BigDataViewer for visualization.

Reverting to an archived Fiji version does not seem to fix the issue.

Environment: Windows 10 Enterprise (1709)

[ERROR] Module threw error
java.lang.UnsatisfiedLinkError: Unable to load library 'blosc': Native library (win32-x86-64/blosc.dll) not found in resource path (file:/...file:/C:/Users/marct/Desktop/Fiji.app/plugins/z_spacing-1.1.1.jar])
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:303)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
	at com.sun.jna.Native.register(Native.java:1647)
	at com.sun.jna.Native.register(Native.java:1360)
	at org.blosc.IBloscDll.<clinit>(IBloscDll.java:15)
	at org.blosc.JBlosc.init(JBlosc.java:30)
	at org.blosc.JBlosc.<init>(JBlosc.java:24)
	at org.janelia.saalfeldlab.n5.blosc.BloscCompression.<clinit>(BloscCompression.java:70)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.janelia.saalfeldlab.n5.CompressionAdapter.update(CompressionAdapter.java:83)
	at org.janelia.saalfeldlab.n5.CompressionAdapter.getJsonAdapter(CompressionAdapter.java:175)
	at org.janelia.saalfeldlab.n5.AbstractGsonReader.<init>(AbstractGsonReader.java:57)
	at org.janelia.saalfeldlab.n5.s3.N5AmazonS3Reader.<init>(N5AmazonS3Reader.java:142)
	at org.janelia.saalfeldlab.n5.s3.N5AmazonS3Reader.<init>(N5AmazonS3Reader.java:182)
	at bdv.img.n5.XmlIoN5S3ImageLoader.getReader(XmlIoN5S3ImageLoader.java:120)
	at bdv.img.n5.XmlIoN5S3ImageLoader.fromXml(XmlIoN5S3ImageLoader.java:85)
	at bdv.img.n5.XmlIoN5S3ImageLoader.fromXml(XmlIoN5S3ImageLoader.java:49)
...
1 Like

This is likely due to version skew between some libraries shipped by the MoBIE update site and those that are now available on the Java-8 update site (and centrally managed by pom-scijava). For example:

It likely wasn’t an issue previously because this artifact was shipped by the N5 update site previously, and you probably didn’t have MoBIE and N5 activated at the same time.

/cc @Christian_Tischer

3 Likes

Hi @mtakeno,
What works for me is the following temporary workaround.
The exact sequence of the steps is very important:

  1. Download a fresh Fiji
  2. Update and restart Fiji (without adding MoBIE) until it says “up to date” when you try to update again
  3. Only now add the MoBIE update site
  4. Never update this Fiji again

The point of following this exact sequence is that the libraries shipped with MoBIE are the last ones to be installed and thus replace all the other ones.

Does that work for you as well? For me, MoBIE and the PlatyBrowser work…

However most likely many other things will not work in this Fiji. Thus, for now please copy this Fiji and rename it to Fiji-MoBIE.app and only use it for MoBIE.

I am of course working on making everything compatible again, but this may take several days.
I will post here once I managed.

3 Likes

Thank you for your reply - I tried the exact sequence but still get the same error, unable to load ‘blosc’ and etc.

No worries, I know all of the developers are hard at work fixing these things, but I just wanted to put a notice in the forums for people who may specifically be looking for MoBIE issues.

I was just excited to start MoBIE and the PlatyBrowser to demo it for a journal club I am presenting today for our group (on the recent bioRxiv preprint)

Thanks again!

Marc

2 Likes

@mtakeno Can you try deleting jars/n5-blosc-1.1.0.jar and see if the problem goes away? We moved n5-blosc into Fiji core last night, but it looks like there is some problem with it. Removing the n5-blosc JAR file should disable Blosc and hopefully get you past that error for now.

CC @axtimwalde

1 Like

Yes, that solved it! Thank you.

2 Likes

Great, glad to hear! :smile:

@Christian_Tischer Just FYI, I don’t think it works that way… the db.xml.gz info from each update site is merged together from the top down, with update sites further down the list merging on top of update sites further up the list. So the MoBIE update site shipping an artifact will always take precedence over that artifact from a core site, regardless of whether the MoBIE site’s version is older or newer than the core site’s version. Have you experienced otherwise?

1 Like

Ok, thanks for the clarification. I did not know this! And I can confirm that when you update Fiji again after installing MoBIE it does not replace the MoBIE artifacts.

=> @mtakeno I looks like you can update you MoBIE Fiji if needed.

1 Like

@mtakeno can you please let me know what the version of jars/n5-????.jar is? I am suspicious because we explicitly catch the UnsatisfiedLinkError to exit without registering the compressor in N5. You would still see the message printed but also a note with a typo:

Compression 'org.janelia.saalfeldlab.n5.blosc.BloscCompression' could not me registered because:...

Also, are you using a system wide Java installation, and if so which version? I am asking because I see the word “Module” in your error message which could indicate that this is an issue with Java 11+…

1 Like

If it’s coming from the MoBIE update site (https://sites.imagej.net/MoBIE/jars/) as stated above, it should be n5-2.1.1.jar.

Thanks @axtimwalde!

FYI, the “Module threw error” is talking about SciJava modules, in this case a Command plugin. The relevant code is here:

Looks like I am evil and rethrow the caught exception (considered a bad practice! But I didn’t know that till recently). I changed it to use exception chaining instead:

1 Like

Thanks @imagejan. That makes sense.

@Christian_Tischer Do you want me to mark the N5 artifacts on the MoBIE site obsolete? I can do that directly in the db.xml.gz if that helps you. Let me know.

So, is the issue including blosc resolved by updating to the correct n5 version because the newer n5 version would capture the error? That would be good because it means that the compression discovery is robust when other things break.

We should still find out why the dll could not be loaded because it should sit happily in lib/win64/blosc.dll can you confirm that it is there? If it is there, then the resource path, that previously included this path on Windows platforms, is broken and does not include this path on Windows platforms now. I do not know where the resource path is being generated.

@mtakeno can you do me a favor and try to put the jars/n5-blosc-1.1.0.jar back and try with the up-to-date jars/n5-2.2.1.jar that is distributed from the Java-8 update site? n5-2.1.1 does NOT yet catch the UnsatisfiedLinkError.

1 Like

I have n5-2.1.1.jar

… and I am fairly certain that I am not using a system wide Java - just that which came with Fiji. But I am on Windows 10 and on a machine that I did not configure myself so I am not 100% positive, but I do not recall installing Java separately.

I don’t think we can necessarily conclude that. But you can check from inside Fiji by:

  • shift+[ to open the Script Interpreter
  • In the text field on the bottom right, typing:
    println(System.getProperty("java.library.path"))
    
    and pressing return

On my macOS system, I see:

>>> println(System.getProperty("java.library.path"))
<null>
/Users/curtis/Applications/Fiji.app/lib/macosx:/Users/curtis/Applications/Fiji.app/mm/macosx

On Windows 64-bit, you should see lib/win64 instead.

2 Likes

@axtimwalde - Sorry, I can’t seem to find n5-2.2.1.jar - do yo uhappen to have a direct link?

Of course: https://maven.scijava.org/service/local/artifact/maven/redirect?r=releases&g=org.janelia.saalfeldlab&a=n5&v=2.2.1&e=jar

But this is also the version that is distributed by the Java-8 update site. So as soon as n5 is marked obsolete on the MoBIE site, you would get the correct version via the updater.

Also, can you please do what @ctrueden said above. To get a print in the log window, you can also call

ij.IJ.log(System.getProperty("java.library.path"))

instead.

Here’s the output from the library path query:

C:\Users\marct\Desktop\Fiji.app/lib/win64;C:\Users\marct\Desktop\Fiji.app/mm/win64

And replacing jars/n5-blosc-1.1.0.jar and substituting jars/n5-2.2.1.jar loads the imagery in the BDV window but also throws errors:

Adding source: sbem-6dpf-1-whole-raw...
Compression 'org.janelia.saalfeldlab.n5.blosc.BloscCompression' could not me registered because:
java.lang.UnsatisfiedLinkError: Unable to load library 'blosc': Native library (win32-x86-64/blosc.dll) not found in resource path ([file:/C:/Users/marct/Desktop/Fiji.app/jars/imagej-launcher-5.0.3.jar, file:/C:/Users/marct/Desktop/Fiji.app/jars/ahocorasick-0.2.4.jar, file:/C:/Users/marct/Desktop/Fiji.app/jars/annotations-13.0.jar, file:/C:/Users/marct/Desktop/Fiji.app/jars/antlr-3.5.2.jar, 
...

Trying to use the volume viewer throws a few errors on my end as well.

C:\Users\marct\.ImageJ_3D_Viewer.props (The system cannot find the file specified)
Exception in thread "Thread-56" java.lang.NoClassDefFoundError: itc/utilities/CopyUtils
	at de.embl.cba.tables.ij3d.UniverseUtils.getImagePlus(UniverseUtils.java:78)
	at de.embl.cba.tables.ij3d.UniverseUtils.addSourceToUniverse(UniverseUtils.java:56)
	at de.embl.cba.mobie.viewer.SourcesPanel.showSourceInVolumeViewer(SourcesPanel.java:195)
	at de.embl.cba.mobie.viewer.SourcesPanel.updateSource3dView(SourcesPanel.java:78)
	at de.embl.cba.mobie.viewer.SourcesDisplayUI$2.lambda$actionPerformed$0(SourcesDisplayUI.java:55)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: itc.utilities.CopyUtils
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 6 more

Again, minor quibbles as this is an amazing dataset and errors likely are in my specific configuration (I’ll keep tinkering with my setup), but this work from @Christian_Tischer and friends at EMBL is really outstanding! I am enjoying browsing around the platy worm…

2 Likes

Thanks @mtakeno, that looks right.

@axtimwalde I don’t think the new launcher is to blame here. JBlosc does its own native loading using JNA, which is different than the usual System.loadLibrary.

That class is from this artifact:

https://maven.scijava.org/service/local/artifact/maven/redirect?r=snapshots&g=org.itc&a=image-transform-converters&v=0.1.2-SNAPSHOT&e=jar

I don’t know what it is, or which update site is supposed to be shipping it—but if you could download it manually and put it into your jars , you will probably get past that error with the volume viewer.