正式项目中,web项目中的slf4j* jar包 删除 -- 项目错误记录
来源:互联网 发布:大非农数据是什么意思 编辑:程序博客网 时间:2024/06/10 18:56
否则会与tomcat的lib包里面的slf4j相冲突
参考 http://stackoverflow.com/questions/29504180/slf4j-error-class-loader-have-different-class-objects-for-the-type
PS:linux系统中,实时查看tomcat启动日志
1、先切换到:cd tomcat/logs
2、tail -f catalina.out
3、这样运行时就可以实时查看运行日志了
Ctrl+c 是退出tail命令。
——————————————————————————————————————————————————
The Tomcat log shows you have another slf4j-1.7.7.jar on the classpath:
Using CLASSPATH: /usr/local/Cellar/tomcat/8.0.18/libexec/bin/jul-to-slf4j-1.7.7.jar:/usr/local/Cellar/tomcat/8.0.18/libexec/bin/slf4j-api-1.7.7.jar:/usr/local/Cellar/tomcat/8.0.18/libexec/bin/logback-classic-1.1.2.jar:/usr/local/Cellar/tomcat/8.0.18/libexec/bin/logback-core-1.1.2.jar:/usr/local/Cellar/tomcat/8.0.18/libexec/bin/logback-config/:/usr/local/Cellar/tomcat/8.0.18/libexec/bin/bootstrap.jar:/usr/local/Cellar/tomcat/8.0.18/libexec/bin/tomcat-juli.jar
When Tomcat is been initialized, it initialize jul-to-slf4j and slf4j-api. These jars are been loading by the Classloader which loaded the Tomcat jars (sun/misc/Launcher$AppClassLoader).
When your application tries to access the slf4j-api classes, it uses the WebApplication Classloader (org/apache/catalina/loader/WebappClassLoader), which by default search for classes definition on the app classpath before the system classpath. Note this can be changed: https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html
In Java, the class signature is composed of the class full qualified name and the classloader that loaded the class. If a class is loaded two times from two different classloaders (same hierarchy), there will be two different classes for the JVM. Trying to point a object reference of one class to a variable of the other will trhow a ClassCastException. Check this blog post (item 5) for more info on this:https://techblug.wordpress.com/2012/03/17/classloader-tips/
So, as far as I know, you can fix this by removing the slf4j-*.jar from the Tomcat classpath,or if you have more then one webapp using the same version of slf4j, you can remove the jars from the webapp, so it will use those loaded by Tomcat classloader.
------------------------------------
angularjs中,添加的片段必须完整的包含在一个封闭的元素内,例如 <div></div> 或 <span></span>之内。开放式的多个元素是无法动态添加的。
tomcat超级大坑
将ROOT内文件都删除,将项目部署进ROOT之后,examples docs manager host-manager 这几个二级目录均不能用,否则会和tomcat固有的二级目录冲突!!! 即不能有 http://www.xxx.com/examples/..........等等形式
- 正式项目中,web项目中的slf4j* jar包 删除 -- 项目错误记录
- 导入jar包到web项目中
- Web项目导入jar包 出现java.lang.NoClassDefFoundError错误
- 如何过滤掉web项目中的jar包?
- 在web项目中如何导入jar包
- Eclipse 的 WEB项目中增加 JAR包
- web项目中有jar包还报错ClassNotFoundException
- log4j+slf4j+spring(web项目)
- slf4j.jar日志使用详解--项目开发中经常使用
- web项目常用jar包小结
- web项目常用jar包小结
- maven 动态web项目jar包冲突
- idea java Web 项目导Jar包
- WEB项目拾遗之jar包篇
- myeclipse中web项目导入jar包后启动Tomcat提示缺少jar包的解决方法
- eclipse 如何隐藏项目中的jar包
- 过滤项目中的Jar包的显示
- android项目中的jar包总结
- ExcuteReader详解
- android菜单插件Slidingmenu和Actionbarsherlock组合使用做侧滑菜单
- Android Scrollview+Listview 实现不同条目点赞并计数功能及原理分析(3)
- 如何配置安全的Linux服务器
- objective-c中Category 类别、扩展 专题总结
- 正式项目中,web项目中的slf4j* jar包 删除 -- 项目错误记录
- 关于tuple的创建中
- shared_ptr智能指针源码剖析
- 1085. Perfect Sequence (25)
- 中文标点的Unicode编码
- UITableView编辑
- UVA147 完全背包DP(坑爹精度题)
- HDU 1800-Flying to the Mars(trie树)
- IOS 委托和协议区别和联系