PDA

View Full Version : Cycle Hierarchy Error in Json


nisu83
05-19-2009, 02:04 PM
Hi
I am facing some problem in json.
I have a hierarchy in which a has b i.e
A
|
B---set of A
C –E -- A
D--B
OTHER PROP OF A

(Capital letters are Class)

In my application I am using Hibernate + spring+jsp+jboss+extjs. When I try to Fetch Location object A and try to convert into Json It gives me Cycle Hierarchy Error.
So I register CycleDetectionStrategy as LENIENT/NOPROP. But then it gives some other error. Here it is.

java.sql.SQLException: Unsupported feature
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:439)
at oracle.jdbc.driver.PhysicalConnection.getDBAccessProperties(PhysicalConnection.java:7803)
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._fromBean(JSONObject.java:928)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
.
.
.

What should I Do to avoid this? For time being after fetching A I am making property B null and its working.
Any Help would be appreciated.
Thanks,
Nishu