`
simplehumn
  • 浏览: 186553 次
  • 性别: Icon_minigender_1
  • 来自: 石家庄
社区版块
存档分类
最新评论

There is no result type defined for type 'json'

阅读更多
最近做了个struts2.2.1+spring3.0+hibernate3.3+Ext3.3.1的小例子(JDK6),启动tomcat时总报错
There is no result type defined for type 'json' mapped with name 'success'.  Did you mean 'json'? - result - file

从网上查了好长时间,仔细检查自己的jar包,json依赖包都在啊
commons-beanutils-1.7.0.jar 
commons-collections-3.2.jar 
commons-lang-2.3.jar 
commons-logging-1.1.jar 
ezmorph-1.0.4.jar 
json-lib-2.2.3-jdk15.jar 

后来我把jsonplugin-0.33.jar加上了,启动就不报错了。
jsonplugin-0.33.jar

------------------------ 我是分割线 ----------------------------
才疏学浅,不知道具体原因是什么,但据我加减包测试的结果,json-lib-2.2.3-jdk15.jar是用来支持JSONArray.fromObject()这个方法的,用来转sjon用;jsonplugin-0.33.jar可能是支持struts.xml里的
<result type="json"/>

继承json-default。
注意:jar的版本跟框架的版本一致。
struts2.1之前的jar包可能与struts2.1之后的jar包不同
------------------------- 我还是分割线 ---------------------------
之前用的MyEclipse自带的struts,后来新建一个工程把需要的jar包都放进去
发现struts2.2.1-lib有个
struts2-json-plugin-2.2.1.1.jar

如果有了这个jar包,则不能再加jsonplugin-0.33.jar否则报错,有冲突。
分享到:
评论
3 楼 ShorenG 2012-04-25  
问题还是一样,楼主帮忙
2 楼 simplehumn 2011-07-01  
hejiehejie 写道
Caused by: There is no result type defined for type 'json' mapped with name 'success'.  Did you mean 'json'? - result

我这里怎么还是这个问题! 包都有,也没重复。我在公司还可以,因为我在公司的包没拷贝回来,,或者版本是否对应,,,帮忙解决啊,兄弟

请检查 jsonplugin-0.33.jar 是否存在,另外,struts2.1之前版本的jar包可能与struts2.1之后版本的jar包不同,根据自己的struts版本在网上搜索下该用什么版本json的jar包;如果有了struts2-json-plugin-2.x.x.x.jar包,则不能再加jsonplugin-0.33.jar否则报错,有冲突。
1 楼 hejiehejie 2011-06-29  
Caused by: There is no result type defined for type 'json' mapped with name 'success'.  Did you mean 'json'? - result

我这里怎么还是这个问题! 包都有,也没重复。我在公司还可以,因为我在公司的包没拷贝回来,,或者版本是否对应,,,帮忙解决啊,兄弟

相关推荐

Global site tag (gtag.js) - Google Analytics