Play框架Twitter4J库
我尝试将 Twitter4J 库与 Play 一起使用!框架在 dependency.yml 中使用以下依赖项:
require:
- org.twitter4j -> twitter4j-core [2.2,)
之后我让 Play!框架使用以下命令解决依赖关系:
play dependencies --sync
Play!框架告诉我一些依赖项已被驱逐:
slf4j-api 1.5.8 is overriden by slf4j-api 1.6.1
这是 slf4j-api 的更高版本,我尝试运行该应用程序:
play run
但不幸的是我收到以下错误消息:
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)
有人认识这个问题/知道我如何解决或解决吗这个依赖问题?
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不太确定问题出在 slf4j 上。 Trace 方法已添加到 Log4J 1.2.12 中。最有可能的是,对您的项目的一些依赖是在类路径中添加一个比该版本更旧的旧 Log4J,并且缺少 trace 方法。
检查 lib 文件夹中的 jar 以及所有依赖项。
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.
一种解决方案可能是强制使用必要库的特定版本。对于你的情况,它看起来像:
One solution maybe is forcibly to use a particular version of a necessary library. For your case it looks like: