Note that there are some explanatory texts on larger screens.

plurals
  1. POJSONException while converting jsonobj to jsonarray
    primarykey
    data
    text
    <p>I am facing a JSONException while using JSONArray.fromObject(jsonObj). I am not able to figure out the cause behind this exception. Can someone provide some sort of input as to why this error is occured?</p> <pre><code> net.sf.json.JSONException: java.lang.reflect.InvocationTargetException at net.sf.json.JSONObject._fromBean(JSONObject.java:987) at net.sf.json.JSONObject.fromObject(JSONObject.java:168) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:265) at net.sf.json.JSONObject._processValue(JSONObject.java:2808) at net.sf.json.JSONObject.processValue(JSONObject.java:2874) at net.sf.json.JSONObject.setInternal(JSONObject.java:2889) at net.sf.json.JSONObject.setValue(JSONObject.java:1577) at net.sf.json.JSONObject._fromMap(JSONObject.java:1340) at net.sf.json.JSONObject.fromObject(JSONObject.java:159) at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:265) at net.sf.json.JSONArray._processValue(JSONArray.java:2514) at net.sf.json.JSONArray.processValue(JSONArray.java:2539) at net.sf.json.JSONArray.addValue(JSONArray.java:2526) at net.sf.json.JSONArray._fromCollection(JSONArray.java:1057) at net.sf.json.JSONArray.fromObject(JSONArray.java:123) at net.sf.json.JSONArray.fromObject(JSONArray.java:105) at net.sf.json.JSONArray$fromObject.call(Unknown Source) </code></pre> <p>The code is as below :</p> <pre><code>RESTClient restClient = new RESTClient(uri) Map&lt;String, String&gt; args = new HashMap&lt;String,String&gt;(); args.put("responseContentType","ContentType.JSON"); response = restClient.get(args) Object jsonObj = response?.getData() JSONArray jsonResp = JSONArray.fromObject(jsonObj) </code></pre> <p>The response that I get from REST service is as below :</p> <pre><code>[{"contract":"/api/v1/contracts/3","draw":"/api/v1/draws/5","drawName":null,"drawNumber":1,"id":5,"periodFrom":"2007-01-10","periodTo":"2007-02-10"}] </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload