I can get part of data from the Action function, by using the JSONArray.fromObject
method, using AJAX to receive the json object. But it is very strange that the same solution did not work with beans files.
The Error is below. I searched for a solution to the three main errors. Maybe I need to import the java.lang.reflect.InvocationTargetException
library, or add some libs in a package, or maybe Java,util.data
conflicts with util.sql.data
. I am not sure if it will work even I made all of the potential suggestions above.
Error info:
[ 00000015 SystemErr R
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)
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.JSONArray._processValue(JSONArray.java:2513)
at net.sf.json.JSONArray.processValue(JSONArray.java:2538)
at net.sf.json.JSONArray.addValue(JSONArray.java:2525)
at net.sf.json.JSONArray._fromCollection(JSONArray.java:1056)
at net.sf.json.JSONArray.fromObject(JSONArray.java:123)
at net.sf.json.JSONArray.fromObject(JSONArray.java:105)
at
(SearchAction.java:675)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.struts.actions.DispatchAction.dispatchMethod
Caused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:60)
Caused by: java.lang.IllegalArgumentException
at java.sql.Date.getHours(Date.java:79)
... 69 more`]