Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

activemq-all forces me to use log4j slf4j implementation

I would like to use the logback slf4j implementation in my application, but activemq-all is spoiling the classpath by including the log4j implementation classes. I'm not the only one facing that problem, as witnessed by for instance multiple SLF4J bindings Error with activemq-all-5.6.0.jar. According to that post I have to replace activemq-all by

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.

The problem is that I don't have the complete maven dependencies (group id, artifact id, version) for these artifacts. Can someone provide me with a ready-to-use replacement for

        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-all</artifactId>
            <version>5.9.0</version>
        </dependency> 
like image 467
Erik VV Avatar asked Jul 15 '14 10:07

Erik VV


2 Answers

You can use active mq core library. Please note that active mq is backward compatible for client.

    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-core</artifactId>
        <version>5.4.3</version>
          <exclusions>
            <exclusion>                 
              <artifactId>org.slf4j</artifactId>
              <groupId>slf4j-log4j12</groupId>
            </exclusion>
            <exclusion>                 
              <artifactId>log4j</artifactId>
              <groupId>log4j</groupId>
            </exclusion>
        </exclusions>
    </dependency>
like image 189
akshat thakar Avatar answered Oct 12 '22 09:10

akshat thakar


In a nutshell, you have already listed group id/artifact id separated by a colon for the artifact you found. Please note that these satisfy some usecase with ActiveMQ 5.6. For instance activemq-core is not really valid any more - use activemq-client and activemq-broker instead.

Currently, these artifact are bundled in activemq-all. But you may want to check out the pom.xml for your version of choice (this list might change over time). You probably won't need all of them unless you are about to embedd a broker with all transports, plugins and configurations within your applications.

<artifactSet>
  <includes>
    <include>${project.groupId}:activemq-client</include>
    <include>${project.groupId}:activemq-openwire-legacy</include>
    <include>${project.groupId}:activemq-camel</include>
    <include>${project.groupId}:activemq-jaas</include>
    <include>${project.groupId}:activemq-broker</include>
    <include>${project.groupId}:activemq-console</include>
    <include>${project.groupId}:activemq-shiro</include>
    <include>${project.groupId}:activemq-spring</include>
    <include>${project.groupId}:activemq-pool</include>
    <include>${project.groupId}:activemq-jms-pool</include>
    <include>${project.groupId}:activemq-amqp</include>
    <include>${project.groupId}:activemq-http</include>
    <include>${project.groupId}:activemq-mqtt</include>
    <include>${project.groupId}:activemq-stomp</include>
    <include>${project.groupId}:activemq-kahadb-store</include>
    <include>${project.groupId}:activemq-leveldb-store</include>
    <include>${project.groupId}:activemq-jdbc-store</include>
    <include>org.apache.activemq.protobuf:activemq-protobuf</include>
    <include>org.fusesource.hawtbuf:hawtbuf</include>
    <include>org.jasypt:jasypt</include>
    <include>org.apache.geronimo.specs:geronimo-jms_1.1_spec</include>
    <include>org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec</include>
    <include>org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec</include>
    <include>org.apache.geronimo.specs:geronimo-annotation_1.0_spec</include>
    <include>org.slf4j:slf4j-api</include>
    <include>org.slf4j:slf4j-log4j12</include>
    <include>log4j:log4j</include>
  </includes>
</artifactSet>

Ok, the version number for org.apache.activemq should simply be the release you want to use. For the geronimo specs, this is not so obvious.

<dependency>
   <groupId>org.apache.geronimo.specs</groupId>
   <artifactId>geronimo-jms_1.1_spec</artifactId>
   <version>1.1.1</version>
</dependency>

<dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
      <version>1.0.1</version>
</dependency>

<dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-annotation_1.0_spec</artifactId>
      <version>1.1.1</version>
</dependency>
like image 30
Petter Nordlander Avatar answered Oct 12 '22 08:10

Petter Nordlander