java.lang.NoSuchMethodError: org.slf4j.helpers.Util.report(Ljava/lang/String;)V when initializing OpenSaml

StackOverflow https://stackoverflow.com/questions/15863654

문제

I'm using OpenSaml in my maven project. When I try to initialize OpenSaml, using a variation of the DefaultBootstrap class, I get the following stacktrace:

    java.lang.NoSuchMethodError: org.slf4j.helpers.Util.report(Ljava/lang/String;)V
    org.apache.log4j.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:47)
    org.apache.log4j.LogManager.getLogger(LogManager.java:42)
    org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
    org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:103)
    org.opensaml.xml.XMLConfigurator.<init>(XMLConfigurator.java:56)
    org.opensaml.xml.XMLConfigurator.<init>(XMLConfigurator.java:73)

I've tried to do mvn dependency:tree to figure out from where the mismatched version of SLF4J jar is being loaded from. I've also tried passing the -verbose option to Java in mvn.bat. Neither of these options helped. I've tried removing the dependencies in my pom.xml one by one. Again, no luck. If someone could throw some light on how to find the culprit jar or how to solve this error, I'd be grateful.

도움이 되었습니까?

해결책

I would wager that you have slf4j-api.jar version 1.5.0 or earlier in your class path whereas the version of log4j-over-slf4j.jar has a later version.

다른 팁

I got the similar issue. After a lot of exploring and debugging I found that the log4j lib was not compatible. My Custom build jar had hbase async client that required log4j-1.2.12 or higher.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top