2 mr huang ning Mr_Huang_ning 于 2017.08.31 20:04 提问

logger报错找不到slf4j.logger

Caused by: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2317)
at java.lang.Class.getDeclaredFields(Class.java:1762)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:89)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:63)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:417)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:891)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5519)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 40 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
... 54 more

3个回答

oyljerry
oyljerry   Ds   Rxr 2017.08.31 22:24

对应的logger jar包有没有导入。

phenomenonsTell
phenomenonsTell   2017.09.01 08:26

Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger
看看你的slf4j.jar导入没有
如果是maven的话你可能添加了这个依赖但是下载失败需要重新下载一次

phenomenonsTell
phenomenonsTell 回复Mr_Huang_ning: 你应该检查你的本地的.m2/.../slf4j文件夹下是否有.lastupdate文件,如果有,恭喜你的slf4j包是下载失败了,如果没有才是其它问题
2 个月之前 回复
Mr_Huang_ning
Mr_Huang_ning pom里面有这个依赖,项目别人那都能跑,检出来我这跑就报错
2 个月之前 回复
qq_24029841
qq_24029841   2017.09.01 09:03

少包,slf4j.jar有依赖包 log4j.jar,还有,slf4j-log4j.jar,slf4j-api.jar

Csdn user default icon
上传中...
上传图片
插入图片