1、错误描述

严重: 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.getContainer(Dispatcher.java:967)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.init(StrutsPrepareFilter.java:56)
	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:4830)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5510)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	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:745)
Caused by: The Result type [json] which is defined in the Result annotation on the class [class com.you.action.ColumnAction] or determined by the file extension or is the default result type for the PackageConfig of the action, could not be found as a result-type defined for the Struts/XWork package [com.you.action#struts-default#/column] - [unknown location]
	at org.apache.struts2.convention.DefaultResultMapBuilder.createResultConfig(DefaultResultMapBuilder.java:450)
	at org.apache.struts2.convention.DefaultResultMapBuilder.createFromAnnotations(DefaultResultMapBuilder.java:422)
	at org.apache.struts2.convention.DefaultResultMapBuilder.build(DefaultResultMapBuilder.java:200)
	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.createActionConfig(PackageBasedActionConfigBuilder.java:926)
	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfiguration(PackageBasedActionConfigBuilder.java:709)
	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:348)
	at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:274)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
	... 21 more
三月 15, 2015 8:04:52 下午 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:493)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.init(StrutsPrepareFilter.java:56)
	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:4830)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5510)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	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: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.getContainer(Dispatcher.java:967)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
	... 18 more
Caused by: The Result type [json] which is defined in the Result annotation on the class [class com.you.action.ColumnAction] or determined by the file extension or is the default result type for the PackageConfig of the action, could not be found as a result-type defined for the Struts/XWork package [com.you.action#struts-default#/column] - [unknown location]
	at org.apache.struts2.convention.DefaultResultMapBuilder.createResultConfig(DefaultResultMapBuilder.java:450)
	at org.apache.struts2.convention.DefaultResultMapBuilder.createFromAnnotations(DefaultResultMapBuilder.java:422)
	at org.apache.struts2.convention.DefaultResultMapBuilder.build(DefaultResultMapBuilder.java:200)
	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.createActionConfig(PackageBasedActionConfigBuilder.java:926)
	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfiguration(PackageBasedActionConfigBuilder.java:709)
	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:348)
	at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:274)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
	... 21 more
三月 15, 2015 8:04:52 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
三月 15, 2015 8:04:52 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/SSH] startup failed due to previous errors
三月 15, 2015 8:04:52 下午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [/SSH] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@3ea3f4a1]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
三月 15, 2015 8:04:52 下午 org.apache.catalina.startup.HostConfig deployDirectory

2、错误原因

/**
 *
 * @title:ColumnAction.java
 * @Package:com.you.action
 * @Description:<h3>一句话描述功能</h3>
 * @author:游海东
 * @date:2015-3-15下午4:52:52
 * @version V1.0
 *
 */
package com.you.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.you.model.ColumnChart;
import com.you.utils.RandomUtils;

/**
 *
 * 项目名称:SSH
 * 类名称:ColumnAction
 * 类描述:
 * 创建人:游海东
 * 创建时间:2015-3-15下午4:52:52
 * 修改人:游海东
 * 修改时间:2015-3-15下午4:52:52
 * 修改备注:
 * @version V1.0
 *
 */
@Component
@Controller("columnAction")
@Scope("prototype")
@ParentPackage("struts-default")
@Namespace("/column")
public class ColumnAction extends ActionSupport
{
	/**
	 *
	 * @Field:serialVersionUID
	 * @Field_Type:long
	 * @Field_Name:ColumnAction.java
	 *
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 图形
	 */
	private ColumnChart cchart = new ColumnChart();

	/**
	 * @author YouHaidong
	 * @date 2015-03-15
	 * @throws Exception
	 * @return 字符串
	 */
	@Override
	@Action(value="columnChart",results={@Result(name="success",type="json")})
	public String execute() throws Exception
	{
		//调用图形方法
		cchart = buildChart();

		return SUCCESS;
	}

	/**
	 * 形成柱状图
	 * 方法名:buildChart
	 * 方法类型:ColumnAction
	 * 参数:@return
	 * @return:ColumnChart
	 * @throws
	 */
	public ColumnChart buildChart()
	{
		ColumnChart chart = new ColumnChart();
		for(int i=1;i<=12;i++)
		{
			chart.setLabel(i+"月");
			chart.setValue(RandomUtils.findChart(i));
		}
		return chart;
	}

	/**
	 * @return the cChart
	 */
	public ColumnChart getCchart()
	{
		return cchart;
	}

}

由于“@ParentPackage("struts-default")”是“struts-default”,而在Action中“@Action(value="columnChart",results={@Result(name="success",type="json")})”,写成type="json"

3、解决办法

/**
 *
 * @title:ColumnAction.java
 * @Package:com.you.action
 * @Description:<h3>一句话描述功能</h3>
 * @author:游海东
 * @date:2015-3-15下午4:52:52
 * @version V1.0
 *
 */
package com.you.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.you.model.ColumnChart;
import com.you.utils.RandomUtils;

/**
 *
 * 项目名称:SSH
 * 类名称:ColumnAction
 * 类描述:
 * 创建人:游海东
 * 创建时间:2015-3-15下午4:52:52
 * 修改人:游海东
 * 修改时间:2015-3-15下午4:52:52
 * 修改备注:
 * @version V1.0
 *
 */
@Component
@Controller("columnAction")
@Scope("prototype")
@ParentPackage("struts-default")
@Namespace("/column")
public class ColumnAction extends ActionSupport
{
	/**
	 *
	 * @Field:serialVersionUID
	 * @Field_Type:long
	 * @Field_Name:ColumnAction.java
	 *
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 图形
	 */
	private ColumnChart cchart = new ColumnChart();

	/**
	 * @author YouHaidong
	 * @date 2015-03-15
	 * @throws Exception
	 * @return 字符串
	 */
	@Override
	@Action(value="columnChart",results={@Result(name="success",location="/pages/columnChart.jsp")})
	public String execute() throws Exception
	{
		//调用图形方法
		cchart = buildChart();

		return SUCCESS;
	}

	/**
	 * 形成柱状图
	 * 方法名:buildChart
	 * 方法类型:ColumnAction
	 * 参数:@return
	 * @return:ColumnChart
	 * @throws
	 */
	public ColumnChart buildChart()
	{
		ColumnChart chart = new ColumnChart();
		for(int i=1;i<=12;i++)
		{
			chart.setLabel(i+"月");
			chart.setValue(RandomUtils.findChart(i));
		}
		return chart;
	}

	/**
	 * @return the cChart
	 */
	public ColumnChart getCchart()
	{
		return cchart;
	}

}

Caused by: The Result type [json] which is defined in the Result annotation on the class的更多相关文章

  1. Struts2 中 result type=”json” 的参数解释

    转自:http://wangquanhpu.iteye.com/blog/1461750 1, ignoreHierarchy 参数:表示是否忽略等级,也就是继承关系,比如:TestAction 继承 ...

  2. jquery序列化from表单使用ajax提交返回json数据(使用struts2注解result type = json)

    1.action类引入struts2的"json-default"拦截器栈 @ParentPackage("json-default") //示例 @Paren ...

  3. struts2.xml 中result type属性说明

    chain           用来处理Action链,被跳转的action中仍能获取上个页面的值,如request信息.           com.opensymphony.xwork2.Acti ...

  4. There is no result type defined for type 'json' mapped with name 'success'. Did you mean 'json'?

    错误信息: 严重: Exception starting filter struts2 Unable to load configuration. - action - file:/C:/Users/ ...

  5. 扩展struts2的结果集StrutsResultSupport 自定义Result处理JSON

    以前在采用Struts2开发的项目中,对JSON的处理一直都在Action里处理的,在Action中直接Response,最近研读了一下Struts2的源码,发现了一个更加优雅的解决办法,自己定义一个 ...

  6. Struts2自定义Result处理JSON

    以前在采用Struts2开发的项目中,对JSON的处理一直都在Action里处理的,在Action中直接Response,最近研读了一下Struts2的源码,发现了一个更加优雅的解决办法,自己定义一个 ...

  7. struts2 Result Type四个常用转跳类型

    Result的四个常用转跳类型分别为 Dispatcher 用来转向页面,是Struts的默认形式 Redirect   重定向到一个URL Chain  用来处理Action链 RedirectAc ...

  8. A query was run and no Result Maps were found for the Mapped Statement 'user.insertUser!selectKey'. It's likely that neither a Result Type nor a Result Map was specified.

    使用mybatis时出现异常问题: 有如下的错误 Error querying database. Cause: org.apache.ibatis.executor.ExecutorExceptio ...

  9. Struts2 中result type属性说明

    Struts2 中result type属性说明 首先看一下在struts-default.xml中对于result-type的定义: <result-types><result-t ...

随机推荐

  1. CentOS的软件包的管理之rpm和yum

    在linux上,一个软件包通常由二进制程序,库文件,配置文件和帮助文件组成. 其中: 二进制程序一般都放在/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin和/u ...

  2. linux下安装phpunit简单方法

    现在安装phpunit相当简单,只需要下载phar压缩格式的phpunit文件,给个执行权限,就可以执行了 以下是一段官方安装文档 wget https://phar.phpunit.de/phpun ...

  3. 关于document.body.scrollTop与documentElement.scrollTop

    遇到document.body.scrollTop值为0的问题 今天在写一个小demo的时候,使用滚动条,我用document.body.scrollTop获取滚动条的位置,但是很奇怪的发现在谷歌上获 ...

  4. ABP官方文档翻译 8.2 SignalR集成

    SignalR集成 介绍 安装 服务器端 客户端 建立连接 內建特征 通知 在线客户端 PascalCase与CamelCase对比 你的SignalR代码 介绍 ABP中的Abp.Web.Signa ...

  5. android adb shell and monkey 学习记录

    Monkey环境: android SDK and JDK SDK目录下的platform-tools和tools目录要配置环境变量 查看版本: ADB 的安装这里就不多说了,输入以下命令有如下提示就 ...

  6. Zookeeper启动时报8080端口被占用

    zookeeper启动时报8080 端口被占用,导致启动失败.特别是服务器上部署了tomcat服务时需要注意. 通过查看zookeeper的官方文档,发现有3种解决途径: (1)删除jetty. (2 ...

  7. web前端性能优化问题

    常用的几大优化解决: 页面内容的优化 减少http请求 途径: 1>启用http/2--越来越多的浏览器都开始支持 HTTP/2.HTTP/2 为同一服务器的并发连接问题带来了很多好处.换句话说 ...

  8. BZOJ 1815: [Shoi2006]color 有色图 [Polya DFS 重复合并]

    传送门 题意: 染色图是无向完全图,且每条边可被染成k种颜色中的一种.两个染色图是同构的,当且仅当可以改变一个图的顶点的编号,使得两个染色图完全相同.问N个顶点,k种颜色,本质不同的染色图个数(模质数 ...

  9. BZOJ 2419: 电阻 [高斯消元 物理]

    http://www.lydsy.com/JudgeOnline/problem.php?id=2419 题意: n个点m个电阻构成一张图,求1到n的等效电阻 第一节课看一道题弃疗,于是来做这道物理题 ...

  10. POJ 1830 开关问题 [高斯消元XOR]

    和上两题一样 Input 输入第一行有一个数K,表示以下有K组测试数据. 每组测试数据的格式如下: 第一行 一个数N(0 < N < 29) 第二行 N个0或者1的数,表示开始时N个开关状 ...