apache-log4j-extras also declares `Appender` interface

倾然丶 夕夏残阳落幕 提交于 2019-12-11 08:45:03

问题


My classpath, as generated by Gradle, includes both apache-log4j-extras-1.2.17.jar, and log4j-1.2.17.jar. I believe these were both downloaded from Maven Central. In any case, in files I have in front of me, all the class and interface definitions from the log4j jar in the org.apache.log4j package are duplicated in the "extras" jar. When log4j is initialized, there's a class-loading conflict:

java.lang.ClassCastException: org.apache.log4j.rolling.RollingFileAppender cannot be cast to org.apache.log4j.Appender

What's the easiest thing to do here? Simply build and publish the JAR of "extras" to my company's Ivy server? I don't know why you'd redeclare the Appender interface.

来源:https://stackoverflow.com/questions/40029109/apache-log4j-extras-also-declares-appender-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!