Friday 22 July 2011

Camel 2.7.0 and SLF4J

While upgrading an application written from camel2.6.0 to 2.7.0, I hit the following error:
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]
which shortly prevented camel from starting as soon as a bean tries to log.

The solution looks quite easy: just add to pom.xml:
<properties>
    <slf4j-version>1.6.1</slf4j-version>
</properties>
and in dependencies:
 <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-version}</version>
    </dependency>

I also deleted the log4j dependency.

I'm not really sure whether thir behaviour is somehow caused by logback, which I used also before, in camel2.6.0.