struts异常:Caused by: Parent package is not defined: json-default - [unknown location]解决办法

时间:2022-09-20 19:40:56

问题描述:

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:445)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4660)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5298)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: Parent package is not defined: json-default - [unknown location]
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildPackageContext(XmlConfigurationProvider.java:670)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:519)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:258)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 20 more
十二月 17, 2016 9:33:15 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter Struts2
Unable to load configuration. - [unknown location]
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:501)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4660)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5298)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
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:445)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)
... 18 more
Caused by: Parent package is not defined: json-default - [unknown location]
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildPackageContext(XmlConfigurationProvider.java:670)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:519)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:258)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 20 more

报错原因:

配置Action时  继承包是json-default

<package name="text" namespace="/okk" extends="json-default">
        
      <action name="ImagesAction_*" class="com.zj.practice.action.UpLoadImageAction"  method="{1}">  
          <result name="images" type="json">list</result>           
      </action> 
        
    </package>

解决办法:导入struts2-json-plugin-2.3.16.3.jar    包

struts异常:Caused by: Parent package is not defined: json-default - [unknown location]解决办法的更多相关文章

  1. 忘记导入struts2-xxx-plugin-x&period;x&period;x&period;jar导致服务器启动报Unable to load configuration&period;Caused by&colon; Parent package is not defined&colon; xxx-default

    今天做的一个Struts2+MyFaces(JSF)+Spring的应用,为了使用JSF,我的struts.xml中使用了如下代码 <package name="jsf" e ...

  2. struts2使用json返回数据,报错:Parent package is not defined&colon; json-default - &lbrack;unknown location&rsqb;

    使用struts2的struts-json插件时,一直报错:找不到json-default的位置,下面是我的查错步骤: 1.将struts-json版本更改为低版本,结果还是报这个错 2.重新导入ma ...

  3. Visual Studio2012打开时弹出&OpenCurlyDoubleQuote;遇到异常:这可能是由某个扩展导致的”错误的解决办法

    Visual Studio2012打开时弹出"遇到异常:这可能是由某个扩展导致的"错误的解决办法: 具体问题如下: 分析原因:网上搜集了以下,出现异常的原因是安装了第三方控件,然后 ...

  4. mysql删除有外链索引数据&comma;Cannot delete or update a parent row&colon; a foreign key constraint fails 问题的解决办法

    mysql删除有外链索引数据Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法查询:DELETE ...

  5. 执行Hive时出现org&period;apache&period;hadoop&period;util&period;RunJar&period;main&lpar;RunJar&period;java&colon;136&rpar; Caused by&colon; java&period;lang&period;NumberFormatException&colon; For input string&colon; &quot&semi;1s&quot&semi;错误的解决办法(图文详解)

    不多说,直接上干货 问题详情 [kfk@bigdata-pro01 apache-hive--bin]$ bin/hive Logging initialized -bin/conf/hive-log ...

  6. 安装newman error&colon;package exports for &&num;39&semi;c&colon;&bsol;nmp&bsol;node&lowbar;modules&bsol;newman&bsol;node&lowbar;module 解决办法

    一.场景描述: 通过npm安装newman时,一直失败. 尝试了很多安装命令: npm install -g newman npm install -g newman --registry=http: ...

  7. 【转】 &num;1451 - Cannot delete or update a parent row&colon; a foreign key constraint fails 问题的解决办法

    转载地址:http://blog.csdn.net/donglynn/article/details/17056099 错误 SQL 查询: DELETE FROM `zmax_lang` WHERE ...

  8. Caused by&colon; Cannot locate the chosen ObjectFactory implementation&colon; spring - &lbrack;unknown location&rsqb; 的解决方式

    1.添加网上所说的struts2 plugin jar包 2. <!-- Struts2配置 --> <filter> <filter-name>struts2&l ...

  9. 通过 Sublime Package Control 安装插件后不能用的解决办法

    最近使用 Sublime 写 SASS 的时候需要使用高亮功能,通过 Package Control 安装了相关插件,但是安装之后没有反应,再次打开 Package Control 的时候,已经搜索不 ...

随机推荐

  1. 05&lowbar;动手动脑之String&period;equals&lpar;&rpar;方法的实现代码

    Question: 请查看String.equals()方法的实现代码,注意学习其实现方法. Answer: java中的String.equals()方法的实现代码: equals()法是根类Obj ...

  2. Saltstack远程执行(四)

    Saltstack远程执行 语法例:salt '*' cmd.run 'w' -  命令:salt -  目标:'*' -  模块:cmd.run,自带150+模块,也可以自己写模块 -  返回:执行 ...

  3. 异常积累:org&period;hibernate&period;StaleStateException

    ERROR - Exception executing batch:  org.hibernate.StaleStateException: Batch update returned unexpec ...

  4. 编译andriod源码出错:java&period;lang&period;UnsupportedClassVersionError&colon; com&sol;google&sol;doclava&sol;Doclava &colon; Unsupported

    问题:java.lang.UnsupportedClassVersionError: com/google/doclava/Doclava : Unsupported update-java-alte ...

  5. C&num; - Dictionary join keys or join Values

    using System; using System.Collections.Generic; using System.Linq; using System.Text; public class P ...

  6. SSM的 日常错误 之 mybatis

    HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemExc ...

  7. eclipse下搭建shell脚本编辑器--安装开发shell的eclipse插件shelled

    具体请看: 亲测有效: http://www.cnblogs.com/shellshell/p/6122811.html

  8. 这可能是最简明扼要的 js事件冒泡机制&plus;阻止默认事件 讲解了

    哎 js事件冒泡机制和阻止冒泡 阻止默认行为好像永远也整不清楚,记了忘 忘了记...醉了 这篇文章写完以后下次再忘记 就呼自己一巴掌,忘一次一巴掌 首先要明白两个概念——事件和事件流 事件指的是用户或 ...

  9. Oracle子查询相关内容&lpar;包含TOP-N查询和分页查询&rpar;

    本节介绍Oracle子查询的相关内容: 实例用到的数据为oracle中scott用户下的emp员工表,dept部门表,数据如下: 一.子查询 1.概念:嵌入在一个查询中的另一个查询语句,也就是说一个查 ...

  10. curator教程二——分布式锁

    简介   在分布式环境下,为了防止多个服务同时修改同一个值,出现数据同步问题,通常用redis和zookeeper做分布式锁,在这里我们用zookeeper做分布式锁,并和单点环境中ReenTranL ...