简体   繁体   English

JBoss多个SLF4J绑定错误

[英]JBoss multiple SLF4J bindings error

I am using JBoss 6 and am getting a multiple versions error when trying to run my application: 我正在使用JBoss 6,并在尝试运行我的应用程序时遇到多个版本错误:

ERROR [STDERR] SLF4J: Class path contains multiple SLF4J bindings. 错误[STDERR] SLF4J:类路径包含多个SLF4J绑定。

ERROR [STDERR] SLF4J: Found binding in [vfs:/C:/jboss-6.0.0.Final/common/lib/slf4j-jboss-logmanager.jar/org/slf4j/impl/StaticLoggerBinder.class] 错误[STDERR] SLF4J:在[vfs:/ C:/jboss-6.0.0.Final/common/lib/slf4j-jboss-logmanager.jar/org/slf4j/impl/StaticLoggerBinder.class]中找到绑定

ERROR [STDERR] SLF4J: Found binding in [vfs:/C:/jboss-6.0.0.Final/server/default/deploy/newsroom-integration-persistence-service.war/WEB-INF/lib/slf4j-log4j12-1.6.1.jar/org/slf4j/impl/StaticLoggerBinder.class] 错误[STDERR] SLF4J:在[vfs:/ C:/jboss-6.0.0.Final/server/default/deploy/newsroom-integration-persistence-service.war/WEB-INF/lib/slf4j-log4j12-中找到绑定1.6.1.jar /组织/ SLF4J / IMPL / StaticLoggerBinder.class]

My application declares slf4j-log4j12 in the pom but not slf4j-jboss-logmanager so have no idea why its trying to use this. 我的应用程序在pom中声明了slf4j-log4j12,但没有在slf4j-jboss-logmanager中声明,所以不知道为什么它试图使用它。 This is the pom: 这是pom:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>${org.slf4j-version}</version>
    <scope>runtime</scope>
</dependency>

Any ideas on how to resolve this? 关于如何解决这个问题的任何想法? It seems to be causing 'DEBUG' level errors to be written to the console even when the level-name set in jboss-logging.xml is set to INFO!! 即使jboss-logging.xml中设置的level-name设置为INFO,它似乎也会导致'DEBUG'级错误写入控制台!!

It doesn't matter what you declare in your pom.xml , JBoss is going to load what's in its common classpath. 你在pom.xml声明什么并不重要,JBoss将加载它的公共类路径中的内容。 If you prefer to use the log4j binding, then you have to remove C:/jboss-6.0.0.Final/common/lib/slf4j-jboss-logmanager.jar . 如果您更喜欢使用log4j绑定,则必须删除C:/jboss-6.0.0.Final/common/lib/slf4j-jboss-logmanager.jar This is the approach recommended by Alfresco . 这是Alfresco推荐的方法。 Quoting: 引用:

You may see the following errors during the startup: 您可能会在启动期间看到以下错误:

2011-10-12 10:47:21,505 ERROR [STDERR] (main) SLF4J: Class path contains multiple SLF4J bindings. 2011-10-12 10:47:21,505错误[STDERR](主要)SLF4J:类路径包含多个SLF4J绑定。

2011-10-12 10:47:21,505 ERROR [STDERR] (main) SLF4J: Found binding in [vfszip:/usr/local/jeap51/jboss- as/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/StaticLoggerBinder.class] 2011-10-12 10:47:21,505 ERROR [STDERR](主要)SLF4J:在[vfszip:/ usr / local / jeap51 / jboss- as / common / lib / slf4j-jboss-logging.jar / org /中找到绑定SLF4J / IMPL / StaticLoggerBinder.class]

2011-10-12 10:47:21,505 ERROR [STDERR] (main) SLF4J: Found binding in [vfszip:/usr/local/jeap51/jboss -as/server/W51J51I1/deploy/alfresco.war/WEB-INF/lib/slf4j-log4j12-1.5.11.jar/org/slf4j/impl/StaticLoggerBinder.class] 2011-10-12 10:47:21,505 ERROR [STDERR](主要)SLF4J:在[vfszip:/ usr / local / jeap51 / jboss -as / server / W51J51I1 / deploy / alfresco.war / WEB-INF /中发现绑定LIB / SLF4J-log4j12-1.5.11.jar /组织/ SLF4J / IMPL / StaticLoggerBinder.class]

2011-10-12 10:47:21,505 ERROR [STDERR] (main) SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 2011-10-12 10:47:21,505 ERROR [STDERR](主要)SLF4J:请参阅http://www.slf4j.org/codes.html#multiple_bindings以获得解释。

To avoid these errors, remove the /common/lib/slf4j-jboss-logging.jar file. 要避免这些错误,请删除/common/lib/slf4j-jboss-logging.jar文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM