I tried to use the Twitter4J library with the Play! framework using the following dependency in dependencies.yml:
require:
- org.twitter4j -> twitter4j-core [2.2,)
After that I let Play! framework resolve the dependencies using the following command:
play dependencies --sync
Play! framework tells me that some dependencies have been evicted:
slf4j-api 1.5.8 is overriden by slf4j-api 1.6.1
That being a higher version of the slf4j-api I tried to run the application:
play run
But unfortunately I get the following error message:
16:19:47,208 ERROR ~ Oops. Error in Logger !
java.lang.NoSuchMethodError: org.apache.log4j.Logger.trace(Ljava/lang/Object;)V
at play.Logger.trace(Logger.java:200)
at play.Play.init(Play.java:221)
at play.server.Server.main(Server.java:158)
Does anyone recognize this problem / know how I can solve or work around this dependency issue?
Thanks!
I’m not so sure the issue is on slf4j. Trace method was added to Log4J 1.2.12. Most likely some dependency on your project is adding an old Log4J in the classpath that’s older than that version and lacks the trace method.
Check the jars in your lib folder, as well as all your dependencies.