Struts 2中的action-default包

时间:2013-10-01 11:26:25

标签: java inheritance configuration struts2 package

是否有与Struts2相关联的action-default这样的包?

我不确定它来自哪个jar(struts-core或plugins),但它已经存在于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:

  
      
  1. struts2-core 2.1.8
  2.   
  3. struts2-convention-plugin 2.1.8
  4.   
  5. struts2-spring-plugin 2.1.8
  6.   
  7. struts2gwtplugin 0.2.1
  8.   
  9. struts2-jfreechart-plugin 2.1.6
  10.   
  11. struts2-jquery-plugin 3.5.0
  12.   
  13. struts2-json-plugin 2.1.8.1
  14.   

对于上面提到的所有罐子,struts并没有抱怨&#34; action-default&#34;封装

将以下jar更新到版本2.3.8后,struts开始抱怨包丢失,

  
      
  1. struts2-core 2.3.8
  2.   
  3. struts2-convention-plugin 2.3.8
  4.   
  5. struts2-spring-plugin 2.3.8
  6.   
  7. struts2-json-plugin 2.3.8
  8.   

2 个答案:

答案 0 :(得分:1)

Struts默认配置中没有这样的包名action-default,包名称为struts-default。更改程序包扩展的程序包的名称。

答案 1 :(得分:0)

我也得到了同样的问题,但是它的工作效果比下面列出的JAR还多,

公地文件上传-1.3.2.jar 公地IO-2.2.jar 公地lang3-3.2.jar 共享记录-1.1.3.jar freemarker的-2.3.22.jar 了Javassist-3.11.0.GA.jar OGNL-3.0.19.jar Struts2的核心 - 2.3.30.jar struts2的-JSON-插件,2.3.30.jar XWork的核 - 2.3.30.jar

MY STRUTS.XML看起来像,

cbq> \SET -creds bucket1:abc123;
cbq> create primary index on bucket1;
cbq> select * from bucket1 where ..... ;
....
  • REGARDS,SUBODH K SINGH