Bio-Formats Exception (after recent update)

I figured out an issue when trying to open either a .lsm or a .czi file using Bio-Formatsit throws the following exception

[ERROR] java.lang.NoSuchMethodException: Could not find method java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
There was a problem with the class java.nio.ByteBuffer which can be found here:
/C:/Users/broch/Downloads/Fiji.app/java/win64/jdk1.8.0_172/jre/lib/rt.jar
java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
	at loci.common.NIOFileHandle.buffer(NIOFileHandle.java:650)
	at loci.common.NIOFileHandle.<init>(NIOFileHandle.java:133)
	at loci.common.NIOFileHandle.<init>(NIOFileHandle.java:151)
	at loci.common.NIOFileHandle.<init>(NIOFileHandle.java:165)
	at loci.common.Location.getHandle(Location.java:522)
	at loci.common.Location.getHandle(Location.java:462)
	at loci.common.Location.getHandle(Location.java:443)
	at loci.common.Location.getHandle(Location.java:426)
	at loci.common.Location.checkValidId(Location.java:551)
	at loci.formats.ImageReader.getReader(ImageReader.java:182)
	at loci.plugins.in.ImportProcess.createBaseReader(ImportProcess.java:627)
	at loci.plugins.in.ImportProcess.initializeReader(ImportProcess.java:485)
	at loci.plugins.in.ImportProcess.execute(ImportProcess.java:138)
	at loci.plugins.in.Importer.showDialogs(Importer.java:140)
	at loci.plugins.in.Importer.run(Importer.java:76)
	at loci.plugins.LociImporter.run(LociImporter.java:78)
	at ij.IJ.runUserPlugIn(IJ.java:230)
	at ij.IJ.runPlugIn(IJ.java:193)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:748)

I first thought it was due to my former Fiji installation.
When I downloaded a new Fiji version. it worked again. If I then ran an update and activated the Bio-Formats update site, the error occurred again. Several of my students in a course had the same problem. So it might be related to the (or one of the last) updates. Potentially, the one yesterday evening.
Uninstalling the update site, resolves the issue

Fiji already comes with Bioformats IIRC - by activating the Bioformats update site you’re probably ending up with duplicate Bioformats versions and that mess of versions can cause problems.

I know, the update site just gives you the most recent releases. And the last one seems to create the problem. See here: Fiji won't open CZI files after update - There was a problem with the class Java
So, it is definitely related to the Bio-Formats update

1 Like

Hi @biovoxxel, you are correct that this was caused by one the jars on the latest Bio-Formats update site. A fix will be available from that update site shortly.

Until then using the last official Bio-Formats release, available from the Java-8 update site will also resolve the problem.

1 Like

Hie
I’ve the same matter with .lif files. Could you please explain (or link) how to use “the last official Bio-Formats release, available from the Java-8 update site”
thanks a lot
pi

Hi all,

Exactly the same issue with .mvd2 and .nd2 files after latest bioformats update.
@dgault: can you please elaborate on how to use the last official bio-formats release instead of the one that is now part of ImageJ?

thanks

There are 2 separate update sites with Bio-Formats builds, the Java-8 site contains the official releases and is what I would recommend people use. The Bio-Formats update site contains nightly builds which may be used for testing new features or getting the latest bug fixes ahead of time. This particular issue is seen with the latest nightly builds.

To get the last official release:

  • In Fiji go to Help > Update > Manage Update Sites
  • Select the Java-8 update site
  • Deselect the Bio-Formats update site
  • Then run the updater as before
  • Update the Bio-Formats jars (specifically you will want ome-common-6.0.4)
1 Like

@dgault Thanks, this fixes the problem.
I wasn’t aware of the fact that the Bio-Formats update site provides ‘preliminary’ builds. That’s good to know.

As a further update, the issue with the Bio-Formats update site should now be corrected as the new ome-common jar has now been uploaded.

2 Likes