您的位置:首页 > 编程语言 > Java开发

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

2014-06-27 16:38 323 查看
1.问题描述:

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

 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:913)

 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:154)

 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)

 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)

 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)

 ... 18 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:904)

 ... 22 more

项目部署到服务器后,第一次启动服务器后,项目可以运行,但是redeploy之后,出现上述的问题提示,并且项目跑不动了。

2.问题分析和解决

如果没猜错的话,应该是使用的MyEclipse开发工具引入的Hibernate的类库。但是,MyEclipse Hibernate 类库中多了两个包: xml-apis.jar和xerces-2.6.2.jar. 它们与JDK的功能存在冲突,需要将这两个Jar包删除。具体步骤如下:

1.将项目中通过MyEclipse开发环境导入的所有SSH相关的libraries,右键----Build Path----Remove from Build Path。

2.此时不要重新部署项目,此时需要到Tomcat的webapps目录下,找到项目的名字,进入lib中,将除了xml-apis.jar和xerces-2.6.2.jar之外的所有的jar包都拷贝到MyEclipse开发环境的WEB-INF下的lib文件夹中

3.重新部署项目



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: