[ome-devel] Sl4j warnings in Matlab w/bio-formats

Sebastien Besson (Staff) s.besson at dundee.ac.uk
Mon Aug 21 09:15:38 BST 2017


Hi Ian,

you are correct the Bio-Formats uber JARs bundle all dependencies incl.
the ones already shipped in MATLAB like the logging JARs. Is this behavior
only present with the MATLAB runtime or do you get the same warnings
when using MATLAB?

For end-users, these warnings should not affect the application despite their
verbosity. As you said, there would be a couple of ways to address them:

- creating a separate uber JAR without the conflicting dependencies i.e. the
  equivalent of you are currently doing
- using individual JARs: the bioformats_package.jar bundled with Bio-Formats
  MATLAB is only used as a fallback if the Bio-Formats JARs are not found in
  the Java class path.

Depending on your build system, it might be possible to write a simple pom.xml
file that copies all Bio-Formats dependencies for a given version into the right
location excluding the  conflicting ones.
See [1] for an example of such POM used by OME to update the decoupled JARs
in Fiji.

Seb

[1] https://github.com/openmicroscopy/bio-formats-fiji/blob/master/pom.xml

On 16 Aug 2017, at 12:32, Munro, Ian <i.munro at imperial.ac.uk<mailto:i.munro at imperial.ac.uk>> wrote:

Hello All

After a recent upgrade to Matlab 2016b we started to see warnings like those below in our deployed Matlab application:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Applications/MATLAB/MATLAB_Runtime/v91/java/jarext/slf4j/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/xxxx/Library/Application%20Support/.mcrCache9.1/FLIMfi0/BFMatlab/bioformats_package.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

Should anyone else encounter this issue.
The solution was to add the following line to the build script.
(Thanks to Curtis Rueden IIRC for suggesting this)

zip -d bfmatlab/bioformats_package.jar 'org/slf4j/impl/*’

It occurs to me that making a .jar file without these components available for download somewhere, might
be something the OME team might like to consider.

Best Wishes

Ian






_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20170821/e6578e64/attachment.html>


More information about the ome-devel mailing list