[slf4j-dev] [JIRA] (SLF4J-492) multiple_bindings warning impossible to disable on Windows using wildcard classpath

QOS.CH (JIRA) noreply-jira at qos.ch
Thu May 14 21:45:00 CEST 2020


Phil Walker created SLF4J-492:
---------------------------------

             Summary: multiple_bindings warning impossible to disable on Windows using wildcard classpath
                 Key: SLF4J-492
                 URL: https://jira.qos.ch/browse/SLF4J-492
             Project: SLF4J
          Issue Type: Bug
          Components: slf4j-simple
    Affects Versions: 1.7.30
         Environment: Windows 10

java 1.8.0_251

scala 2.13.2

 
            Reporter: Phil Walker
            Assignee: SLF4J developers list


Classpath consists primarily of jars below a directory, via '-classpath 'c:\opt\uejlib2.13*'

 

Warning issued by slf4j:

 
 SLF4J: Class path contains multiple SLF4J bindings.
 SLF4J: Found binding in [jar:file:/opt/uejlib2.13/slf4j-nop-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
 SLF4J: Found binding in [jar:file:/c:/opt/uejlib2.13/slf4j-nop-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
 SLF4J: See [http://www.slf4j.org/codes.html#multiple_bindings] for an explanation.
 SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]



The two jar paths differ only with respect to one of them having a drive letter ("C:") and the other not.   Because of the way the jar was specified (via a directory wildcard -classpath), there would not appear to be any way to fix this on the client side.

 

If the two paths are compared via "java.io.File.getCanonicalPath", the apparent duplication is removed, making SLF4J less demanding of client code.

 

By the way, our project only pulls SLF4J in by way of a transitive dependency, and this spurious warning is quite problematic for us.

 

Thanks for your consideration!

 



--
This message was sent by Atlassian Jira
(v8.8.0#808000)


More information about the slf4j-dev mailing list