2 Replies Latest reply on Aug 14, 2017 5:06 PM by Kamil BÜKÜM

    infinispan-embedded/9.1.0.Final -Multiple SLF4J bindings problem

    Kamil BÜKÜM Newbie

      Hello,

       

      I am using logback but when I tried to use "orbit" framework which is used "infinispan-embedded/9.1.0.Final" jar as dependency I got Multiple SLF4J bindings problem. As I see logging implementation is exist in "infinispan-embedded/9.1.0.Final". I can exclude it but It's not using just for logging. I solve the problem

      to use infinispan-embedded as logger and exclude "logback" jar from dependencies. But I think it is not right way to solve the problem. I think logging implementation should be in another jar as dependency of "infinispan-embedded/9.1.0.Final" jar. Then I can exclude it. It is not right way to be dependent logger jar because of another task.

      This is  another issue opened by someone on stackoverflow java - Can not upgrade infinispan to 9.1.0.Final: ClassCastException - Stack Overflow

       

      You can see error detail below:

       

      Error Detail :

      SLF4J: Class path contains multiple SLF4J bindings.

      SLF4J: Found binding in [jar:file:/.../.m2/repository/org/infinispan/infinispan-embedded/9.1.0.Final/infinispan-embedded-9.1.0.Final.jar!/org/slf4j/impl/StaticLoggerBinder.class]

      SLF4J: Found binding in [jar:file:/.../.m2/repository/ch/qos/logback/logback-classic/1.1.9/logback-classic-1.1.9.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.jboss.slf4j.JBossLoggerFactory]

      Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.jboss.slf4j.JBossLoggerFactory loaded from file:/Users/kamilbukum/.m2/repository/org/infinispan/infinispan-embedded/9.1.0.Final/infinispan-embedded-9.1.0.Final.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.jboss.slf4j.JBossLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext

      at org.springframework.util.Assert.isInstanceOf(Assert.java:346)

      at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:273)

      at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:97)

      at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:230)

      at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:209)

      at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)

      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)

      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)

      at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:68)

      at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)

      at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)

      at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134)

      at com.finartz.fsm.server.backend.BackendServer.main(BackendServer.java:25)