vivo-project/VIVO-Harvester — Issue #1: SLF4J and ActiveMQ are Incompatible in V 1.3
Author: drspeedo
Created: 2012-03-02 02:23:08+00:00
State: open

Original posted on JIRA#VIVOHARV-120 - http://issues.library.cornell.edu/browse/VIVOHARV-120

When running Harvester tools utilizing logging via slf4j, the following error occurs:

SLF4J: The requested version 1.6 by your slf4j binding is not compatible with 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
at ch.qos.logback.classic.spi.LoggingEvent.(LoggingEvent.java:112)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:471)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:427)
at ch.qos.logback.classic.Logger.info(Logger.java:631)
at org.vivoweb.harvester.fetch.SOAPFetch.main(SOAPFetch.java:275)

This error was introduced when org.vivoweb.harvester.util.ImageQueueConsumer was added. This class uses ActiveMQ, which uses slf4j in a way that does not gracefully handle different versions in other classes. This is a reported bug and can be found at https://issues.apache.org/jira/browse/AMQ-3296 .

A workaround for developers exists. In pom.xml, the activemq dependency needs to be removed or commented out, and then ImageQueueConsumer.java removed or renamed to an innocuous extension like .txt. In pom.xml, as of the creation of this bug report the text that would be commented-out looks like this:

org.apache.activemq
activemq-all
5.5.0

org.slf4j
slf4j-api

Then rebuild Harvester via Maven and the rest of the tools work.

Obviously this workaround is unsuitable for released software and therefore the bug needs to be resolved in some way before the next Harvester release.