If you create a new Spring Boot project (using start.spring.io for example) and add java-kit dependency, the application won't start because of a SLF4J binding error:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError.
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.apache.commons.logging.LogFactory$Slf4jDelegate.createLocationAwareLog(LogFactory.java:174)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:111)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:99)
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:198)
)
Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
at org.slf4j.impl.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:54)
... 11 more
It fails because java-kit has a dependency on slf4j-log4j12. The library should only use the SLF4J API without a specific binding (the project should choose the logger binding to use). More information on SLF4J and bindings here.
This PR fix this error by replacing slf4j-log4j12 and log4j dependencies by the simple slf4j-api dependency.
Hello team!
If you create a new Spring Boot project (using start.spring.io for example) and add
java-kit
dependency, the application won't start because of a SLF4J binding error:It fails because
java-kit
has a dependency onslf4j-log4j12
. The library should only use the SLF4J API without a specific binding (the project should choose the logger binding to use). More information on SLF4J and bindings here.This PR fix this error by replacing
slf4j-log4j12
andlog4j
dependencies by the simpleslf4j-api
dependency.This PR depends on #56
Thanks and happy hacktoberfest!