将json对象发送到Java服务器独立应用程序时出错 [英] Error when sending the json object to Java server standalone application

查看:141
本文介绍了将json对象发送到Java服务器独立应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将JSON对象发送到Java独立应用程序中的服务器.

JSON对象是:

{"dateFrom":"0001-01-01 12:00:00"
,"dateTo":"2014-03-29 04:34:49"
,"currency":"AUD"
,"requestStatus":null
,"dateTimeCreated":null
,"requestName":"ProjectedFundingRequest"
,"id":"af2e7ceb-c181-4a6b-a212-2867ea5cfded"
,"loginName":"mendiras"
,"securityToken":null
,"jsonString":null}

error : net.sf.json.JSONException: Error while setting property=requestStatus type class java.lang.String

请让我知道导致上述错误的原因.

解决方案

您正在JSON中传递一些空数据,请确保服务器接受这种类型的输入,否则在服务器调用时会给出错误消息.

I am sending the JSON object to server in a Java standalone application .

JSON object is :

{"dateFrom":"0001-01-01 12:00:00"
,"dateTo":"2014-03-29 04:34:49"
,"currency":"AUD"
,"requestStatus":null
,"dateTimeCreated":null
,"requestName":"ProjectedFundingRequest"
,"id":"af2e7ceb-c181-4a6b-a212-2867ea5cfded"
,"loginName":"mendiras"
,"securityToken":null
,"jsonString":null}

error : net.sf.json.JSONException: Error while setting property=requestStatus type class java.lang.String

Please let me know what could be the reason for the above error.

解决方案

You are passing some null data in your JSON, Make sure server is accept this type of input otherwise at the time of server call it gives a error.

这篇关于将json对象发送到Java服务器独立应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆