在tomcat启动时报错:
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\lvlf\workspace\ssh\target\ssh\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
...
Caused by: java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
...
原因分析:
jar文件版本冲突.从网上查询得知类: org.slf4j.impl.StaticLoggerBinder在slf4j-api 中是类的公有静态变量,而在slf4j-log4j12(slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar其中之一)中确是私有变量
解决办法:
在类路径先将slf4j-api.jar 删除,再导入同版本的slf4j-api-1.5.6.jar 和slf4j-log4j12-1.5.6.jar
sl4j的一个版本冲突
原创
©著作权归作者所有:来自51CTO博客作者mb5c80f4c73b73a的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:oracle 学习小结8
下一篇:oracle 学习小结7
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Day21logj4与sl4j的区别
学习目标(1)Junit 针对方法(2)log4j与sl4j(3)Spring - IOClog4j的介绍(1)什么是log4j?Log4j是Apach
log4j java sl4j apache 数据 -
sl4j与logback.xml配置详解
Ceki Gülcü在Java日志领域世界知名。他创造了Log4J ,这个最早的Java日志框架即便在JRE内置日志功能的竞争下仍然非
python java 大数据 linux 数据库 -
日志组件Sl4j 介绍,xml配置文件 参数详解
级别中文名称级别等级详解OFF关闭1Level 是最高等级的,用于关闭所有日志记录。FATAL致命的错误2level 指出每个严重
日志组件Sl4j 介绍 xml配置文件 sed ide xml -
sl4j 日志记录至es slf4j日志配置
Slf4j 日志详解1、 jar 包依赖 <dependency>  
sl4j 日志记录至es slf4j apache 默认值 System