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

https://stackoverflow.com/questions/31433246/classcastexception-org-slf4j-impl-log4jloggeradapter-cannot-be-cast-to-ch-qos-l

java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger
    de.mypackage.controller.MyController.meinOeOrte(MyController.java:335)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:606)
    org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

Due to an already existing dependency of SLF4J in your project or in some other inherited project, there might be conflicts during runtime. Adding an exclusion to my POM file worked for me:

<exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
            </exclusion>
        </exclusions>
时间: 2024-10-07 19:09:25

org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger的相关文章

org.slf4j.impl.SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext

查看日志信息: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/app/apache-tomcat-docbase/mmsi/WEB-INF/lib/slf4j-simple-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/app/apache-t

java.lang.AbstractMethodError: org.slf4j.impl.Log4

启动 Pivotal tc Server Developer Edition v3.0的时候报的错,下面得慢慢解决啊,有懂的给我回复一下哈,我要是解决了也会回复在文章下面的 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.AbstractMethodError:

SLF4J: Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;.

调试Mina程序出现如下错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-operation (NOP) logger implementationSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 下载相应的slf4j的jar包,在slf4

Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;

调试程序出现如下错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-operation (NOP) logger implementationSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 下载相应的slf4j的jar包,在slf4j官网下

解决Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;

解决Failed to load class "org.slf4j.impl.StaticLoggerBinder" 解决办法,两步: 一.在编译路径中添加Log4J的包,比如我一直在用的log4j-1.2.8.jar: 二.再添加一个叫做slf4j-log4j12-1.5.11.jar的包进行转换,注意到这里的log4j12,可能对应的是log4j 1.2版本.解决! 补充: SLF4J官方下载:http://www.slf4j.org/download.html 下载对应版本后加压

【SLF4J: Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;.】解决办法

[问题描述] Maven工程中,使用了slf4j,运行时出现错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [

java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory

java.lang.IllegalAccessError: tried to access field org.slf4j.impl.Static.. java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory 使用hbm2java时,使用hibernate-distribution- 3.3.1

【Hibernate】Hibernate3.x独立运行时的Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;错误

按理说,如果Hibernate不依附于SSH运行,像<[Struts2+Hibernate3+Spring3]利用SSH整合,完成打印用户表,用户登录.注册.修改密码系统>(点击打开链接)一样,把hibernate-distribution-3.6.10.Final解压之后,把根目录的hibernate3.jar,hibernate-distribution-3.6.0.Final\lib\required下的所有jar,hibernate-distribution-3.6.0.Final\l

kafka 报Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;.[z]

转:http://blog.chinaunix.net/uid-25135004-id-4172954.html 测试kafka    producer发送消息 和  consumer 接受消息报错 ,kafka版本kafka_2.9.2-0.8.1 [[email protected] ~]#  /export/kafka/bin/kafka-console-producer.sh  --broker-list 10.14.2.201:9092,10.14.2.202:9092,10.14.2