Question

In my project i'm using Hibernate3 (depends on slf4j-1.6) and RESTeasy (depends on slf4j-1.5). Both are not compatible and give errors at runtime.

SLF4J: The requested version 1.5.8 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
        at org.slf4j.impl.SimpleLogger.formatAndLog(SimpleLogger.java:222)
        at org.slf4j.impl.SimpleLogger.info(SimpleLogger.java:258)
        at org.hibernate.annotations.common.Version.<clinit>(Version.java:37)

Any ideas to solve this conflict ?

Was it helpful?

Solution

I am not familiar with RESTeasy however I have encountered this problem before, I just updated all slf4j jars to the later version and found that the api I was using that depended on the older version still worked on version 1.6.

Give it a go it can't hurt to try.

Edit: I should just say, make sure you update both the slf4j api (slf4j-api-1.x.x.jar) and the plugin (e.g. slf4j-log4j12-1.x.x.jar) to the same version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top