multiple SLF4J bindings Error with activemq-all-5.6.0.jar

前端 未结 2 1955
野的像风
野的像风 2020-12-05 10:19

When I upgrade to activemq-all-5.6.0

I get this error during server startup

SLF4J: Class path contains multiple SLF4J bindings

I don\'t have this i

相关标签:
2条回答
  • 2020-12-05 10:52

    The ActiveMQ guys use the Maven Shade Plugin to create the activemq-all "ueber" jar. Somewhere between version 5.5.1 and 5.6.0 they added the org.slf4j:slf4j-log4j12 dependency - hence your problem.

    Unfortunately because they used the shade plugin you can not use exclusions in your activemq-all dependency definition in your POM.

    Instead you will need to completely replace the activemq-all dependency with all the required individual dependencies (except of course the org.sl4j-log4j12 one).

    The following page details all the required dependencies: http://activemq.apache.org/initial-configuration.html#InitialConfiguration-RequiredJARs

    Alternatively the following is the list of all dependencies (required and optional) included in the activemq-all jar (taken from the configuration of the shade plugin in the activemq-all pom):

    org.apache.activemq:activemq-camel
    org.apache.activemq:activemq-core
    org.apache.activemq:activemq-console
    org.apache.activemq:activemq-jaas
    org.apache.activemq:activemq-optional
    org.apache.activemq:kahadb
    org.apache.geronimo.specs:geronimo-jms_1.1_spec
    org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec
    org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec
    org.apache.geronimo.specs:geronimo-annotation_1.0_spec
    org.slf4j:slf4j-api
    org.slf4j:slf4j-log4j12
    log4j:log4j
    

    Hope that helps.

    0 讨论(0)
  • 2020-12-05 11:01

    I had the same problem while using Spring. What helped me was replacing the dependency of activemq-all with:

    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-spring</artifactId>
        <version>5.14.3</version>
    </dependency>
    

    Hope this will help anyone...

    0 讨论(0)
提交回复
热议问题