在后台查询出一个数据集合后,准备将它转成json对象给页面,结果报异常了:
net.sf.json.JSONException: java.lang.reflect.InvocationTargetException
at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:793)
at net.sf.json.JSONObject._fromBean(JSONObject.java:689)at net.sf.json.JSONObject.fromObject(JSONObject.java:161)
at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:274)
at net.sf.json.JSONObject._processValue(JSONObject.java:2573)
at net.sf.json.JSONObject.processValue(JSONObject.java:2639)
at net.sf.json.JSONObject.setInternal(JSONObject.java:2654)
at net.sf.json.JSONObject.setValue(JSONObject.java:1349)
at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:740)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1132)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
at net.sf.json.JSONObject.defaultBeanProcessing(JSONObject.java:724)
... 131 more
Caused by: java.sql.SQLException: 不支持的特性: getCursorName
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.BaseResultSet.getCursorName(BaseResultSet.java:37)
at com.mchange.v2.c3p0.impl.NewProxyResultSet.getCursorName(NewProxyResultSet.java:545)
... 141 more
后来调试发现,集合的元素对象中有包含byte数组的属性对象,就是在转换该属性时报的异常! 反正页面上没用到这个属性,干脆把这个属性置空了,异常就解决了