首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

Tomcat xalan包摩擦导Error filterStart Context startup failed due to previous errors

2012-07-25 
Tomcat xalan包冲突导Error filterStart Context startup failed due to previous errors转载我从一台机器

Tomcat xalan包冲突导Error filterStart Context startup failed due to previous errors
转载
我从一台机器上考过来的一个用struts2框架的测试例子,但启动tomcat的时候就出现Error filterStart Context startup failed due to previous errors 访问的时候就会报404,从baidu和Google上看看了看,总说纷纭,各种错误都有,下面我总结一下在几种可能出现的情况,因个人的情况不同产生的原因也不同,我这里只是说说我遇到的。

遇到这样的情况,首先去看tomcat的日志,查查具体的原因,有可能是你的web.xml配置的过滤器出错了(字母书写是否正确)或者struts.xml 配置出错了,确保以上两个没问题的情况下,这个时候在看看jdk和tomcat的版本,我在网上看到:由于jdk1.5 与 tomcat5.0之间的关于 TransformerFactoryImpl 类的冲突造成的。
tomcat-5.0.28\common\endorsed下有两个jar包:xercesImpl.jar和xml-apis.jar,其中的类 javax.xml.transform.TransformerFactory 与jdk1.5中的类org.apache.xalan.processor.TransformerFactoryImpl其实是同一个类。
in tomcat java is called with the following argument:
-Djava.endorsed.dirs="X:\my_app\Portal\tomcat\common\endorsed"
In this directory you find two jar files: xercesImpl.jar and xml-apis.jar needed by tomcat and that must be loaded before all xmsl stuff present in the jdk (1.4 naming problem). And in the file xml-apis.jar the TransformerFactoryImpl is set to "org.apache.xalan.processor.TransformerFactoryImpl".

解决办法:
1. 将xml-apis.jar移出endorsed文件夹。
2. 用xalan系列jar包替换原来的xercesImpl.jar和xml-apis.jar。
xalan系列jar包:serializer.jar、xalan.jar、xercesImpl.jar和xml-apis.jar。
3. For other application, just check this file or dom3-xml-apis.jar in your class path.
我测试过了,jdk1.5和tomcat5.0可以,不会出现上面的问题,我不清楚出现过上面的情况,反正这里我没有遇到过。接下来我又测试了jdk1.6和tomcat.5.5也是可以的和jdk1.5和tomcat5.5也是可以的。tomcat的lib目录下的jar包和struts2的lib目录下的jar包。希望能给到家一点帮助。

1 楼 cheng871230 2012-02-03   开发webservice遇到这个问题了,谢谢提供解决办法和资源哦

热点排行