[ome-devel] Sl4j classpath issues in deployed Matlab

Curtis Rueden ctrueden at wisc.edu
Fri Mar 31 15:28:17 BST 2017


Hi Ian,

> Is there any other component, or combination of components that I can
> try ?

Two possibilities come to mind:

1) Use the Bio-Formats JARs piecemeal, excluding the logback-common
dependency from your dependency hierarchy. You can lean on Maven to resolve
your dependencies.

2) Massage the bioformats_package/loci_tools archive to stop shipping any
SLF4J bindings.

I filed PR #300 which pursues option (2); maybe it helps you.
https://github.com/flimfit/FLIMfit/pull/300

In the longer term, I encourage the Bio-Formats team to purge the
logback-classic dependency. It should be bundled only with the command line
tools.

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Fri, Mar 31, 2017 at 8:41 AM, Munro, Ian <i.munro at imperial.ac.uk> wrote:

> Hi Again
>
> Is there any other component, or combination of components that I can try
> ?
>
> Thanks
>
> Ian
>
>
> On 31 Mar 2017, at 10:29, Munro, Ian <i.munro at imperial.ac.uk> wrote:
>
> Hi Sebastien
>
> Unfortunately replacing bioformats_package.jar with loci_tools.jar has
> simply replaced the previous warning
> with :
>
> 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/imunro/Librar
> y/Application%20Support/.mcrCache9.1/FLIMfi0/BFMatlab/loci_t
> ools.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>
>
> Best,
>
> Ian
>
> On 30 Mar 2017, at 14:40, Munro, Ian <i.munro at imperial.ac.uk> wrote:
>
> Thanks Sebastien
>
> I’ll give that a try and let you know.
>
> Ian
>
>
> On 30 Mar 2017, at 14:32, Sebastien Besson (Staff) <s.besson at dundee.ac.uk>
> wrote:
>
> Hi Ian,
>
> I think Curtis summarised the nature of the warning which should be
> harmless albeit
> annoying. For reference, OME was historically using log4j and switched to
> logback
> as the default logging implementation a few years ago [1].
>
> Moving towards individual JARs as Curtis suggests might be the best way to
> enable full
> control of the dependencies and prevent conflict in an environment like
> MATLAB.
>
> In the short term, a third alternative might be to use the loci_tools.jar
> rather than
> bioformats_package.jar. The only difference between both bundle JARs is
> effectively the
> logging implementation shipped (log4j vs logback).
>
> Best,
> Sebastien
>
> [1] https://github.com/openmicroscopy/bioformats/pull/889/
>
> On 30 Mar 2017, at 13:49, Munro, Ian <i.munro at imperial.ac.uk> wrote:
>
> Thanks Curtis
>
> Sounds like 2) would be the way to go then.
>
> Ian
>
>
> On 30 Mar 2017, at 13:30, Curtis Rueden <ctrueden at wisc.edu> wrote:
>
> Hi Ian,
>
> > SLF4J: Class path contains multiple SLF4J bindings.
>
> Maybe the docs about that are helpful?
> https://www.slf4j.org/codes.html#multiple_bindings
>
> > if anyone has any thoughts on a work-around that would be great.
>
> The error message suggests that MATLAB now ships its own SLF4J binding.
> This makes sense, since best practice is for apps (like MATLAB and Fiji) to
> choose and ship a binding, rather than for libraries to mandate one.
> Otherwise, this situation can happen. Bio-Formats embeds an SLF4J binding
> into the bioformats_package.jar via its dependency on logback-classic.
> (Specifically: metakit and ome-common and bio-formats_plugins and
> bio-formats_tools all depend on it.)
>
> Fiji's strategy is to ship logback-classic as its chosen SLF4J binding;
> fortunately, Fiji bundles no other libraries with conflicting bindings. But
> since MATLAB now ships its own, a different solution is needed. There are a
> couple of possibilities:
>
> 1) Change Bio-Formats to no longer depend on any JARs which include an
> SLF4J binding. This would be a desirable change in general.
>
> 2) Change FLIMfit to stop using bioformats_package in favor of the
> individual Bio-Formats JARs, and exclude the logback-classic dependency
> from its dependency hierarchy.
>
> Regards,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - https://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
> Did you know ImageJ has a forum? http://forum.imagej.net/
>
>
> On Thu, Mar 30, 2017 at 5:34 AM, Munro, Ian <i.munro at imperial.ac.uk>
> wrote:
>
>> Good afternoon
>>
>> I wondered if anyone has any thoughts on an issue we’re currently having.
>> The next release of our FLIMfit application is nearly ready for release.
>> However when running the deployed version we get a warning:
>>
>> 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/imunro/Librar
>> y/Application%20Support/.mcrCache9.1/FLIMfi0/BFMatlab/biofor
>> mats_package.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
>> explanation.
>>
>> see also https://github.com/flimfit/FLIMfit/issues/299
>>
>> Thiis seems to be a warning only but if anyone has any thoughts on a
>> work-around that would be great.
>> NB this arose with the recent move to Matlab 2016b.
>>
>> Many Thanks
>>
>> Ian
>>
>>
>> _______________________________________________
>> ome-devel mailing list
>> ome-devel at lists.openmicroscopy.org.uk
>> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>>
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>
> _______________________________________________
> ome-devel mailing list
> 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
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>
>
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20170331/d0dc3fbd/attachment.html>


More information about the ome-devel mailing list