Caught exception while loading file struts-default.xml - [unknown location]

SSH整合,服务器启动时报的异常:

Caused by: Unable to load configuration. - [unknown location]
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
 ... 28 more
Caused by: Caught exception while loading file struts-default.xml - [unknown location]
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:902)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:143)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:110)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:168)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
 ... 30 more
Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
 at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
 at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
 at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
 at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
 at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.<init>(SAX2DOM.java:69)
 at com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory.getSerializationHandler(TransletOutputHandlerFactory.java:187)
 at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:392)
 at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.setResult(TransformerHandlerImpl.java:137)
 at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.setup(DomHelper.java:205)
 at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:190)
 at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:181)
 at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:167)
 at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:107)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:893)
 ... 34 more

解决:

jar包有冲突, 应该是XML解析包有冲突. 检查发布后的WEB-INF/lib有两个XML解析包: xml-apis.jar和xerces-2.6.2.jar 这种错误真正原因不是JDK 6和Struts 2冲突, 而是 MyEclipse Hibernate 类库中多了两个包: xml-apis.jar和xerces-2.6.2.jar, 这两个包的功能和JDK的冲突了. 解决办法: 1. 删除发布后目录的 WEB-INF/lib/ 下的这两个文件; 2. 或者使用JDK 1.5来启动Tomcat 6.

具体原因是不是以上所说不清楚,不过删除后确实好了,死马当活马医了。。。

你可能感兴趣的:(Caught exception while loading file struts-default.xml - [unknown location])