org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger

efuton
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:${NGRINDER_HOME}/script/admin/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/data/jetty-7.6.9/work/jetty-0.0.0.0-8080-ngrinder-controller-3.3.war-_ngrinder-controller-3.3-any-/webapp/WEB-INF/lib/logback-classic-1.0.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Exception in thread "main" java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger
        at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:73)
        at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60)
验证脚本出错信息如上

在eclipse下运行通过,哪里logging有问题呢
Reply | Threaded
Open this post in threaded view
|

Re: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger

efuton
pom添加如下即可
<exclusions> 
<exclusion>
 <groupId>org.slf4j</groupId> 
 <artifactId>slf4j-log4j12</artifactId>
 </exclusion> 
 </exclusions>
Reply | Threaded
Open this post in threaded view
|

Re: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger

Mavlarn

这应该是你自己的代码里面使用的别的log包。

我们整个项目都用的slf4j,所有依赖里面如果使用的log4j或者commons-logging之类的,或者其他版本的slf4j,都尽量排除掉。

 

 

 

-----Original Message-----
From: "efuton [via ngrinder]"<[hidden email]>
To: "Mavlarn"<[hidden email]>;
Cc:
Sent: 2015-01-21 (星期三) 16:48:21
Subject: Re: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger
 

pom添加如下即可
<exclusions> 
<exclusion>
 <groupId>org.slf4j</groupId> 
 <artifactId>slf4j-log4j12</artifactId>
 </exclusion> 
 </exclusions>


To start a new topic under ngrinder-user-cn, email [hidden email]
To unsubscribe from ngrinder-user-cn, click here.
NAML