是否有action-default
与 Struts2 相关的软件包?
我不确定它来自哪个 jar(struts-core 或插件),但它已经存在struts.xml
了很多年。我们使用了 struts-core-2.1.8。
我将 struts 版本更新到 2.3.8 并且 struts 开始抱怨,
SEVERE: Exception starting filter struts2-prepare
Unable to load configuration. - [unknown location]
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:483)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.init(StrutsPrepareFilter.java:50)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: Unable to load configuration. - [unknown location]
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
... 15 more
Caused by: Parent package is not defined: action-default - [unknown location]
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildPackageContext(XmlConfigurationProvider.java:660)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:508)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:290)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:239)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 17 more
我找不到任何关于action-default
包装的参考资料。任何人都可以帮我弄清楚action-default
包中可用的内容以及 Struts 2.3.8 中的替代品。
编辑:
发不完整struts.xml
,太长了 包装声明如下,
<package name="default" extends="struts-default,jfreechart-default,json-default,action-default">
使用的 Struts 相关 jar 的工件 ID:
- struts2-core 2.1.8
- struts2-convention-plugin 2.1.8
- struts2-spring-plugin 2.1.8
- struts2gwtplugin 0.2.1
- struts2-jfreechart-插件 2.1.6
- struts2-jquery-插件 3.5.0
- struts2-json-插件 2.1.8.1
有了上面提到的所有 jars,struts 并没有抱怨“action-default”包。
将以下 jar 更新到 2.3.8 版本后,struts 开始抱怨缺少包,
- struts2-core 2.3.8
- struts2-convention-plugin 2.3.8
- struts2-spring-plugin 2.3.8
- struts2-json-插件 2.3.8