log4j-over-slf4j.jar和slf4j-log4j12.jar冲突...但是我没有log4j-over-slf4j [英] log4j-over-slf4j.jar and slf4j-log4j12.jar conflitct... but i don't have log4j-over-slf4j

查看:204
本文介绍了log4j-over-slf4j.jar和slf4j-log4j12.jar冲突...但是我没有log4j-over-slf4j的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的maven项目中将SLF4J与log4j一起使用.当我在Eclipse中的tomcat和带有tomcat maven插件的maven中运行项目时,一切正常.

I use SLF4J with log4j in my maven project. Everything is ok when i running the project in tomcat in eclipse, and in maven with tomcat maven plugin.

但是当我在雄猫生产服务器中发动战争时,该项目无法启动,给了我这个错误.

But when i put the war in my tomcat production server, the project don't start, giving me this error.

java.lang.IllegalStateException:同时检测到log4j-over-slf4j.jar 与类路径上的slf4j-log4j12.jar绑定,抢占 StackOverflowError.也可以看看 http://www.slf4j.org/codes.html#log4jDelegationLoop 了解更多详细信息.

java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.

我已经在stackoverflow中看到许多有关此错误的答案,并且我已经了解到我需要排除冲突jar.问题是我的项目中没有log4j-over-slf4j ... .war的lib文件夹不包含此jar,问题仅在生产服务器的tomcat服务器中出现.我不知道该怎么办.我把我的依赖树放在这里.

I already saw many answers in stackoverflow about this error and i already understood i need to exclude the conflict jar. The problem is i don't have log4j-over-slf4j in my project... The lib folder of the .war don't contain this jar and the problem only hapens in tomcat server of my production server. I don't know what to do. I'm putting here my dependency tree.

[INFO] +- junit:junit:jar:4.12:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- com.sun.faces:jsf-api:jar:2.2.13:compile
[INFO] +- com.sun.faces:jsf-impl:jar:2.2.13:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:5.1.0.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.1.0.Final:compile
[INFO] |  |  +- (org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile - omitted for duplicate)
[INFO] |  |  +- (org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile - omitted for duplicate)
[INFO] |  |  +- (org.javassist:javassist:jar:3.20.0-GA:compile - omitted for duplicate)
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- (org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile - omitted for duplicate)
[INFO] |  |  +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] |  |  +- (com.fasterxml:classmate:jar:1.3.0:compile - omitted for conflict with 1.1.0)
[INFO] |  |  +- (dom4j:dom4j:jar:1.6.1:compile - omitted for duplicate)
[INFO] |  |  \- (org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile - omitted for duplicate)
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  \- (xml-apis:xml-apis:jar:1.0.b2:compile - omitted for conflict with 1.4.01)
[INFO] |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] |  |  \- (org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile - omitted for duplicate)
[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] |  +- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] |  \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  +- (org.jboss.logging:jboss-logging:jar:3.2.1.Final:compile - omitted for conflict with 3.3.0.Final)
[INFO] |  \- com.fasterxml:classmate:jar:1.1.0:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.21:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] |  \- log4j:log4j:jar:1.2.17:compile
[INFO] +- log4j:apache-log4j-extras:jar:1.2.17:compile
[INFO] |  \- (log4j:log4j:jar:1.2.17:compile - omitted for duplicate)
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- org.postgresql:postgresql:jar:9.4.1208.jre7:compile
[INFO] +- org.primefaces:primefaces:jar:6.0:compile
[INFO] +- org.primefaces.themes:start:jar:1.0.10:compile
[INFO] +- commons-io:commons-io:jar:2.5:compile
[INFO] +- org.jxls:jxls-reader:jar:2.0.2:compile
[INFO] |  +- org.apache.commons:commons-digester3:jar:with-deps:3.2:compile
[INFO] |  |  +- cglib:cglib:jar:2.2.2:compile
[INFO] |  |  |  \- asm:asm:jar:3.3.1:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] |  |  |  \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate)
[INFO] |  |  \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.2)
[INFO] |  +- org.apache.commons:commons-jexl:jar:2.1.1:compile
[INFO] |  |  \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate)
[INFO] |  +- org.apache.poi:poi:jar:3.12:compile
[INFO] |  |  \- (commons-codec:commons-codec:jar:1.9:compile - omitted for conflict with 1.10)
[INFO] |  +- org.apache.poi:poi-ooxml:jar:3.12:compile
[INFO] |  |  +- (org.apache.poi:poi:jar:3.12:compile - omitted for duplicate)
[INFO] |  |  \- org.apache.poi:poi-ooxml-schemas:jar:3.12:compile
[INFO] |  |     \- org.apache.xmlbeans:xmlbeans:jar:2.6.0:compile
[INFO] |  |        \- stax:stax-api:jar:1.0.1:compile
[INFO] |  +- (org.slf4j:slf4j-api:jar:1.7.12:compile - omitted for conflict with 1.7.21)
[INFO] |  \- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO] |     \- (org.slf4j:slf4j-api:jar:1.7.12:compile - omitted for conflict with 1.7.21)
[INFO] +- org.jsoup:jsoup:jar:1.9.2:compile
[INFO] +- net.sourceforge.htmlunit:htmlunit:jar:2.22:compile
[INFO] |  +- xalan:xalan:jar:2.7.2:compile
[INFO] |  |  \- xalan:serializer:jar:2.7.2:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[INFO] |  |  +- (commons-logging:commons-logging:jar:1.2:compile - omitted for conflict with 1.1.1)
[INFO] |  |  \- (commons-codec:commons-codec:jar:1.9:compile - omitted for duplicate)
[INFO] |  +- org.apache.httpcomponents:httpmime:jar:4.5.2:compile
[INFO] |  |  \- (org.apache.httpcomponents:httpclient:jar:4.5.2:compile - omitted for duplicate)
[INFO] |  +- commons-codec:commons-codec:jar:1.10:compile
[INFO] |  +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.22:compile
[INFO] |  +- net.sourceforge.htmlunit:neko-htmlunit:jar:2.21:compile
[INFO] |  |  \- xerces:xercesImpl:jar:2.11.0:compile
[INFO] |  |     \- (xml-apis:xml-apis:jar:1.4.01:compile - omitted for conflict with 1.0.b2)
[INFO] |  +- net.sourceforge.cssparser:cssparser:jar:0.9.19:compile
[INFO] |  |  \- org.w3c.css:sac:jar:1.3:compile
[INFO] |  +- (commons-io:commons-io:jar:2.5:compile - omitted for duplicate)
[INFO] |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  \- org.eclipse.jetty.websocket:websocket-client:jar:9.2.17.v20160517:compile
[INFO] |     +- org.eclipse.jetty:jetty-util:jar:9.2.17.v20160517:compile
[INFO] |     +- org.eclipse.jetty:jetty-io:jar:9.2.17.v20160517:compile
[INFO] |     |  \- (org.eclipse.jetty:jetty-util:jar:9.2.17.v20160517:compile - omitted for duplicate)
[INFO] |     \- org.eclipse.jetty.websocket:websocket-common:jar:9.2.17.v20160517:compile
[INFO] |        +- org.eclipse.jetty.websocket:websocket-api:jar:9.2.17.v20160517:compile
[INFO] |        +- (org.eclipse.jetty:jetty-util:jar:9.2.17.v20160517:compile - omitted for duplicate)
[INFO] |        \- (org.eclipse.jetty:jetty-io:jar:9.2.17.v20160517:compile - omitted for duplicate)
[INFO] \- xml-apis:xml-apis:jar:1.4.01:compile 

经过许多其他许多测试之后,此问题仅发生在我的生产服务器tomcat,部署在其他8台服务器中且系统运行正常的情况下.我想这与我的生产服务器tomcat中运行的其他项目有冲突.可以吗?

After many many many other tests, this problem only happens with my production server tomcat, i deployed in other 8 servers and the system runs ok. I suppose it's a conflict with other projects running in my production server tomcat. Can be this possible?

推荐答案

您应该在tomcat/lib文件夹中有一个log4j-over-slf4j.jar.你检查了吗?

You should have a log4j-over-slf4j.jar in tomcat/lib folder. Have you checked it?

这篇关于log4j-over-slf4j.jar和slf4j-log4j12.jar冲突...但是我没有log4j-over-slf4j的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆