I have an action that should return a JSON from an AJAX call, but it throws an exception instead.
Do you have any clue on what could be the cause of the problem ?
Here is my code:
@Results({
@Result(name="json", type="json", params = {"root", "json"})
})
public class TestController{
public String tableData() {
String test = "{'winston':'testing'}";
JSONObject json = JSONObject.fromObject(test);
return "json";
}
}
The exception thrown:
ERROR RestActionInvocation Exception processing the result.
net.sf.json.JSONException: java.lang.reflect.InvocationTargetException
at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:818)
at net.sf.json.JSONObject._fromBean(JSONObject.java:699)
at net.sf.json.JSONObject.fromObject(JSONObject.java:172)
at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274)
at net.sf.json.JSONObject._processValue(JSONObject.java:2655)
at net.sf.json.JSONObject.processValue(JSONObject.java:2721)
at net.sf.json.JSONObject.setInternal(JSONObject.java:2736)
at net.sf.json.JSONObject.setValue(JSONObject.java:1424)
at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:765)