J2EE社区

苟有恒,何必三更起五更眠;
最无益,只怕一日曝十日寒.
posts - 241, comments - 318, trackbacks - 0, articles - 16
今天下午做了一个ssh项目,是利用spring配置文件管理hibernate配置文件,结果一发布出现以下错误,请高手们指教!!!!
严重: Exception starting filter struts2
Caught exception while loading file struts-default.xml - [unknown location]
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:839)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
 at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
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:213)
 at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:198)
 at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:189)
 at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.<init>(DomHelper.java:175)
 at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
 ... 34 more

请高手们指教????


名称: ♪4C.ESL | .↗Evon
口号: 遇到新问题♪先要寻找一个方案乄而不是创造一个方案こ
mail: 联系我


Feedback

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2008-09-23 21:58 by fx
ms这个错误是Struts2的一个bug,以前我也遇见过

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2008-09-24 11:19 by 游四海
看看struts-default.xml 的位置放对没有

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2008-09-25 09:22 by xcp
@游四海
@fx
谢谢你们哈,我已经找到错误的原因了.打了半天,发现有一个Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration错误。我一想肯定是导入的包有问题,结果一看导入的包里面有一个xerces.jar,我也只是想试一试,就把这个包删掉,重新发布、运行发现不报错误了。在一次谢谢各位了哈!!

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2009-01-22 18:15 by sfgsf
为什么我照着视频做的一模一样他是对的,而我是错的!

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2009-02-25 22:15 by Joseph
只要照着下载的struts2的包里給的空白的例子里他所导入的包导入就一定不会错

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2009-07-31 17:55 by ganwb
我没有那个包也是报这样的错啊!

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2009-08-29 00:14 by Annie
@xcp
真的 是这个原因啊!!应该是包和包之前有冲突,我在做SSH2整合时也碰到这个情况,用myeclipse自动导入了hibernate和spring的包,也不知道xerces.jary这个是什么时候进来的,结果删了xerces.jar就可以了.

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml[未登录]  回复  更多评论   

2010-03-09 16:26 by 兰兰
我也遇到这样的问题,解决啦!在status2里面多了一个标签!

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2010-03-18 21:28 by 当当
我也移除那个包了,但还是那个错误啊

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2010-03-18 21:29 by 当当
我也移除那个包了,但还是那个错误啊 为什么呢?请教哪位高手帮忙解决
QQ295833641

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2010-03-31 15:43 by fdfds
是啊,我也是啊

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2010-07-29 14:42 by 茼蒿
struts2-core.jar
xwork.jar
ognl.jar
freemarker.jar
commons-logging.jar
commons-io-1.3.1.jar
commons-fileupload-1.2.jar
将这些JAR都导进去试试

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2010-08-03 10:19 by dsdds
我也是删了xerces.jar就可以了。

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2010-08-05 21:12 by wangzhiquan
@dsdds
我也是删了xerces.jar就可以了,我想问问,这个jar是干什么用的呢?

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2012-03-04 18:04 by @雄
要删除xerces.jar和xml-apis.jar这是应为hibernate的这两个包的功能和jdk的冲突了

# re: 严重: Exception starting filter Struts2 Caught exception while loading file struts-default.xml  回复  更多评论   

2015-07-09 01:42 by xian
我额也是报这样的错误,但是我没有xerces.jar这个包,但我有xml-apis.jar这个包,我删除了,还是报同样的错误,这是什么原因?

只有注册用户登录后才能发表评论。


网站导航: