启动Tomcat时错误如下:
XML-22103: (Fatal Error) DOMResult can not be this kind of node.
2010-1-3 21:30:49 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Class: oracle.xml.jaxp.JXTransformerHandler
File: JXTransformerHandler.java
Method: endDocument
Line: 145 - oracle/xml/jaxp/JXTransformerHandler.java:145:-1
报错原因:
Struts启动时会寻找实现JAXP规范的XML解析器来解析XML文档,刚好xmlparserv2实现了JAXP规范,但它是用来解析Oracle中XMLType类型的,所以Struts在用这个解析器时会报“DOMResult can not be this kind of node”错误。
解决方案:
寻找另一个实现JAXP规范的XML解析器:xalan
下载地址:http://apache.etoak.com/xml/xalan-j/binaries/xalan-j_2_7_1-bin.zip
解压后,将xalan.jar、xercesImpl.jar和serializer.jar三个jar文件拷到/WEB-INF/lib目录下,重启Tomcat,OK!