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

问题描述:

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    包

时间: 2024-10-11 17:03:28

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

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

今天做的一个Struts2+MyFaces(JSF)+Spring的应用,为了使用JSF,我的struts.xml中使用了如下代码 <package name="jsf" extends="jsf-default"> <interceptors> <interceptor-stack name="jsfFullStack"> <interceptor-ref name="params"

struts2使用json返回数据,报错:Parent package is not defined: json-default - [unknown location]

使用struts2的struts-json插件时,一直报错:找不到json-default的位置,下面是我的查错步骤: 1.将struts-json版本更改为低版本,结果还是报这个错 2.重新导入maven依赖,还是不行 3.查看struts-json包内的struts-plugin.xml是否有json-default的package以及json的结果类型,发现有. 4.静下心想了一下整个package的调用过程,都找不到原因 5.最后怀疑是war包的问题,war包内没有这个jar包,打开wa

【转】 #1451 - Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法

转载地址:http://blog.csdn.net/donglynn/article/details/17056099 错误 SQL 查询: DELETE FROM `zmax_lang` WHERE CONVERT( `zmax_lang`.`lang` USING utf8 ) = 'fr' LIMIT 1 MySQL 返回: #1451 - Cannot delete or update a parent row: a foreign key constraint fails (`myre

Tomcate 启动异常,java.net.BindException: Address already in use: JVM_Bind:80的解决办法

一直用Tomcat,但是前几天突然报错:           java.net.BindException: Address already in use: JVM_Bind:80 第一反应就是80端口被占用了. 解决方案: 1.先用命令 netstat -ano 看一下各个端口(Local Address 列的端口号)占用和进程PID. 查看后发现我本地的8080端口被进程PID13888占用 2.然后在任务管理器里,查看进程,找到PID为13888的进程然后结束它(我的13888进程已经结束

tomcat启动异常(严重: Dispatcher initialization failed Unable to load configuration. - [unknown location] )

严重: Dispatcher initialization failed Unable to load configuration. - [unknown location] at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConf

myeclipse非正常关闭引起的异常解决办法

myeclipse非正常关闭,控制台server出现异常“Could not create the view: An unexpected exception was thrown.”. 解决办法: --  删除文件 “workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/ com.genuitec.eclipse.ast.deploy.core.prefs” --  重新启动myeclipse即可

Sublime Text3的Package Control安装教程,及报错解决There Are No Packages Available For Installation

一.Package Control的安装 Sublime 有很多插件,这些插件为我们写python代码提供了非常强大的功能,这些插件需要单独安装.而安装这些插件最方便的方法就是通过Package Control的插件,这其实就是一个插件管理器,帮助我们从Sublime中安装,升级和移除插件,这样对于我们管理插件来说是非常方便的,安装好它之后在通过它来安装其他插件点击Tools 菜单下的Install Package Control 就可以了 出现如下图示,表示安装完成 二.Package Con

Caused by: Unable to locate parent package [json-default] for [class com.you.user.action.StudentActi

1.错误描述 信息: Choosing bean (struts) for (com.opensymphony.xwork2.util.TextParser) 2014-7-13 1:52:04 org.apache.struts2.spring.StrutsSpringObjectFactory info 信息: Initializing Struts-Spring integration... 2014-7-13 1:52:04 com.opensymphony.xwork2.spring.

Caused by: Unable to locate parent package [json-package] for [class com.you.action.ColumnAction] -

1.错误描述 三月 15, 2015 7:53:25 下午 com.opensymphony.xwork2.util.logging.jdk.JdkLogger error 严重: Dispatcher initialization failed Unable to load configuration. - [unknown location] at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Con