当前位置: 首页 > 知识库问答 >
问题:

升级到Struts 2.3.15-约定插件会导致启动时崩溃

丁阎宝
2023-03-14

我正在将Struts2安装升级到2.3.15。添加struts2-convention-plugin-2.3.15.jar后,我的web应用无法启动。例外清单的相关部分为:;

Caused by: Attribute "order" must be declared for element type "struts". - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:119)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1017)
... 16 more

有人知道这是怎么回事吗?

编辑:

完整的痕迹是;

SEVERE: Exception sending context initialized event to listener instance of class org.apache.struts2.dispatcher.ng.listener.StrutsListener
Unable to load configuration. - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:502)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.listener.StrutsListener.contextInitialized(StrutsListener.java:46)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
 Caused by: Unable to load configuration. - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
... 10 more
Caused by: Unable to load jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1022)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:225)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 12 more
 Caused by: Attribute "order" must be declared for element type "struts". - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:119)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1017)
... 16 more
 Caused by: org.xml.sax.SAXParseException; systemId: jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml; lineNumber: 29; columnNumber: 20; Attribute "order" must be declared for element type "struts".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:117)
... 17 more

共有1个答案

公羊俊德
2023-03-14

您应该在struts.xml中使用正确的doctype

<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
  "http://struts.apache.org/dtds/struts-2.3.dtd">
 类似资料:
  • 我试图升级我目前的java项目,运行在1.6到1.8,但程序编译良好如何曾经当我去http://localhost:8080/MyProject/login.jsp-我得到错误。 我正在使用eclipse luna,我将java\u HOME更改为1.8,将eclipse项目facets更改为1.8,并更新了javax。servlet api=3.1.0。 堆栈跟踪 无布局。jsp 我用常春藤做依

  • 我正在尝试使用、和(不使用)实现实时相机应用程序 所以,我发现这篇教程 http://altitudelabs.com/blog/real-time-filter/ 它是用Objective-C编写的,所以我在Swift4.0中重写了那个代码,xcode9 它看起来工作很好,但有时(很少),它崩溃了以下错误。调用的方法时 EXC_BAD_ACCESS(代码=1,地址+0x************)

  • 问题内容: 我要回答我自己的问题,这是问题描述。 因此,我有一个应用程序已在商店中发布,并且由于要发布的新版本,数据库架构已更改,因此我自然不得不进行迁移,以将其从版本3升级到最新版本。 5.这包括提供从3迁移到4以及从4迁移到5的迁移,或者一次迁移从3迁移到5的迁移。 这就是我所做的,我提供了这些迁移,并将其提供给Room databaseBuilder(),一切就绪,以模拟正在发生应用程序升级

  • 问题是,当我在Google中使用授权运行此代码时,它会立即崩溃: 但是日志中的错误: 2019-06-22 17:55:42.652 29327-23222/?E/AudioSource:在已关闭的AudioSource 2019-06-22 17:55:43.240 2093-2616/?E/TouchFilter:setTouchFilter日志启用参数:0 2019-06-22 17:55:

  • 我最近让 STS 将自己从 3.1 更新到 3.5,现在我收到有关 MatchLocator 类的错误。我不确定匹配定位器是什么,但它似乎是 Eclipse 的核心服务。 当我打开STS时,我得到 “初始化Java工具”期间出现内部错误。org/eclipse/JDT/internal/core/search/matching/match locator 打开后,我会为每个applicationC

  • 我正在将我的Maven构建的Java 8应用程序升级到Java 11。在我的POM中,我指定: 当我使用普通的Maven构建调用来构建我的应用程序时: 我得到: 因此,看起来<code>maven编译器插件:3.8.1 那么,我怎么知道是什么把它拉进来并使用它呢?或者如果这不是正在发生的事情,那是什么,我该如何修复它?