MyEclipse 6开发JDK6和Struts 2冲突的问题真实原因及解决办法
用Struts 2+Hibernate开发. 再次遇到了 Struts 2+JDK 6的冲突问题.
以前在正式环境上发布系统的时候都是直接将tomcat进程杀掉然后重启,这样虽然能够保证不出问题,但是如果tomcat容器发布了多个系统就不行,应该这样会导致其他系统也停止,所以后来就通过tomcat后台管理来发布, 这样虽然能发布上去,但是启动不了,报如下错误:
严重: 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:3696)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3086)
at org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java:912)
at org.apache.catalina.manager.HTMLManagerServlet.reload(HTMLManagerServlet.java:523)
at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:113)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
at java.lang.Thread.run(Thread.java:619)
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)
... 31 more
2008-9-19 0:08:34 org.apache.catalina.core.StandardContext start
第一次启动能运行, 在http://localhost:8080/manager/html中reload或start就不行.
那基本可断定是其他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.
解决办法
1>删除发布后的目录下的WEB-INF\lib下的xml-apis.jar和xerces-2.6.2.jar.
2>停止Tomcat,重新启动就可以,不需要再次发布
分享到:
相关推荐
`Caught exception while loading file struts-default.xml - [unknown location]` 这个异常是因为 Struts 框架中的配置文件 `struts-default.xml` 无法正确地加载。 解决方法 2:配置 Struts 框架 要解决这个...
Console 错误:Caught exception while loading file struts-default.xml **问题描述**: ``` Caught exception while loading file struts-default.xml - [unknown location] ``` **解决方法**: 这个错误通常由...
[Content_Types].xml[Content_Types].xml[Content_Types].xml[Content_Types].xml[Content_Types].xml[Content_Types].xml[Content_Types].xml[Content_Types].xml[Content_Types].xml
"VC/C++源码, FileException" 提供了一个学习VC++异常处理机制的实例,这对于初学者来说是极具价值的。 在C++中,异常处理是通过`try`、`catch`和`throw`关键字来实现的。当程序在`try`块中遇到无法正常处理的错误...
nervously and embarrassingly 紧张且尴尬地(副词形式错误) - B. nervous and embarrassedly 紧张且尴尬地(形容词+副词) - C. nervously and embarrassing 紧张的且令人尴尬的(形容词+副词) - D. nervous ...
在给定的"input-caught.rar_Caught"压缩包中,我们可以看到一个名为"输入捕捉通道7.c"的源代码文件,这暗示了该代码是针对特定单片机的输入捕捉功能实现,很可能是用于飞思卡尔(Freescale,现已被NXP半导体收购)的...
std::cerr << "Caught an exception: " << e.what() ; } } ``` 在这个例子中,如果`b`为0,函数会抛出一个`std::invalid_argument`异常,然后在`catch`块中捕获并打印错误信息。 除了标准库提供的异常类型,我们...
the Activiti Engine, and starting in a new job, that time caught up with me. After I had settled in a bit, I took up the writing task again and began working on the remaining chapters. So here I am, ...
这是一种检查学生语法和用词准确性的练习,下面是给出的错误及其纠正: - 1. 将"Get"改为"Getting",动名词形式作主语 - 2. 将"mostly"改为"most",形容词修饰children - 3. 将"founded"改为"founded",过去分词...
5. **题目**:When he was working there he caught a serious illness from _______ efforts he still suffers. - A. which - B. that - C. whose - D. what - **解析**:此题考查关系代词的使用。“whose”...
18. catch - caught 19. fall - fell 20. do - did 21. buy - bought 22. see - saw 23. shop - shopped 24. begins - began 25. e - ate 26. take - took 27. miss - missed 28. like - liked 29. get - got 30. ...
标题中的"No-callback-form-caught"暗示我们将探讨一种不依赖回调函数的网络抓包方法。下面将详细介绍这种技术以及其背后的原理。 网络抓包通常涉及到网络层协议,如TCP/IP协议栈,它允许我们查看原始的数据包,...
5. **强大的异常处理**:Netty提供了强大的异常处理机制,如ChannelInboundHandlerAdapter中的exceptionCaught方法,可以捕获并处理各种网络异常。 6. **灵活的缓冲区**:Netty自定义了ByteBuf作为数据缓冲区,支持...
**解析:** `switch` 表达式支持 `char` 类型,当 `c` 的值等于 `'a'` 时,会匹配到第一个 `case` 条件,输出 "a" 后由于有 `break` 语句,所以不会继续执行后面的 `default` 语句块。 ### 11. 异常处理选择题 **...
6. **强大的异常处理**:Netty提供了一种统一的异常处理机制,通过ChannelInboundHandlerAdapter中的exceptionCaught方法捕获和处理异常,增强了系统的健壮性。 7. **兼容性和稳定性**:Netty 4.0版本是一个成熟的...
4. "catch"(抓住):catch, caught, caught A-B-A型动词的变化则是在过去式和过去分词之间有一个不规则变化。例如: 1. "overcome"(克服):overcome, overcame, overcome 2. "become"(变成):become, became, ...
错误提示中的“Unexpected failure (8000ffff)”明确指出了一个非预期的失败情况,通常这类错误表明程序在执行过程中遇到了未被预料到的问题,导致程序无法正常继续执行。根据提供的信息,我们可以初步判断错误发生...
caught - C. catching - D. to catch **解析**: 此题考查非谓语动词的用法。根据句意,“冲浪者在捕捉海浪的过程中展示他们对海洋的爱与热情”,这里“捕捉海浪”是对“冲浪者”的补充说明,因此应选用现在分词...