weixin_33725126 2010-11-15 02:59 采纳率: 0%
浏览 27

struts2 ajax jsonexception

I am getting the below error when making an AJAX call in my struts2 application:

 org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException:             org.apache.struts2.json.JSONException: java.lang.reflect.InvocationTargetException
 org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:243)
 org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
 org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
 org.apache.struts2.json.JSONWriter.write(JSONWriter.java:99)
 org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:112)
 org.apache.struts2.json.JSONResult.execute(JSONResult.java:198)
 com...hony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
 org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
 org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

The correct Action/method are executed when the ajax call is made.

I made all objects referenced in the Action class implement Serializable.

What can i do to fix this problem? I have been searching on the internet .. but no clues..

  • 写回答

2条回答 默认 最新

  • weixin_33737774 2010-11-15 05:46
    关注

    The found the problem .. I had BidDecimal objects in my class and JSON serialization is not supported for this type. I converted it to String and double and it iw working now.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型