I'm using ActiveMQ (an apache camel component) to send SMS from web to GSM mobile, so I needed to use SLF4J. I got this in the output of my netbeans project when i run it it seems like the jar is present two times, and i think that i need to add an exclusion in the dependency in my pom.xml but i dont know what to do exactly !
This is the part of SLF4 in my pom.xml
:
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
<!-- <exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions> -->
</dependency>
And this is my output while running my project
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/asus/.m2/repository/org/apache/activemq/activemq-all/5.9.0/activemq-all-5.9.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/asus/.m2/repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.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.impl.Log4jLoggerFactory]
Try the following:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.9.0</version>
<type>pom</type>
</dependency>
See more in [AMQ-5009] Switch activemq-all from shaded jar to pom dependency aggregator - ASF JIRA.
Your question is lacking a bit of context, but I'd say you should simply drop that slf4j-log4j12
dependency from your POM, since an SLF4J binding is embedded in activemq-all-5.9.0.jar
anyway.
Or maybe you could try not using activemq-all
with embedded dependencies and use individual ActiveMQ artifacts with ordinary transitive dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With