I get a CyclicReferenceException while using Betwixt to write a bean. We get this exception on our development server - websphere 5.1, JDK 1.4.2.5, AIX 5.2, betwixt 0.7, hibernate 3.1. However the same code worked on my local workstation - webshere 5.1, J2RE 1.4.2 , XP version 5.1, betwixt 0.7, hibernate 3.1. We are using .betwixt files for all bean properties that needs to be written. Any ideas??
Thanks Sailesh ---------------------------------------------------------------Exception Trace---------------------------------------------------------------------------------------------------------------------- [10/13/06 8:50:17:980 EDT] 5e3e469a AbstractBeanW E org.apache.commons.betwixt.io.AbstractBeanWriter Cyclic reference at bean: XXXXXXXX [10/13/06 8:50:17:990 EDT] 5e3e469a SystemErr R org.apache.commons.betwixt.io.CyclicReferenceException: Bean graph contains a cyclic reference [10/13/06 8:50:17:991 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.pushBean(AbstractBeanWriter.java:1014) [10/13/06 8:50:17:991 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:348) [10/13/06 8:50:17:991 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:267) [10/13/06 8:50:17:991 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElementContent(AbstractBeanWriter.java:936) [10/13/06 8:50:17:991 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWriter.java:738) [10/13/06 8:50:17:991 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElementContent(AbstractBeanWriter.java:955) [10/13/06 8:50:17:991 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWriter.java:738) [10/13/06 8:50:17:991 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:374) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:267) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElementContent(AbstractBeanWriter.java:945) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWriter.java:738) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:374) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:267) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElementContent(AbstractBeanWriter.java:936) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWriter.java:738) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:374) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:243) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.java:144) [10/13/06 8:50:17:992 EDT] 5e3e469a SystemErr R at org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:190) ----------------------------------------------------------Code---------------------------------------------------------------------------------------------------------------------- ... outputWriter.write("<?xml version='1.0' ?>"); BeanWriter beanWriter = new BeanWriter(outputWriter); IntrospectionConfiguration introConfig = beanWriter.getXMLIntrospector().getConfiguration(); introConfig.setAttributesForPrimitives(false); introConfig.setMappingDerivationStrategy(MappingDerivationStrategy.USE_INTROSPECTION_TIME_TYPE); introConfig.setWrapCollectionsInElement(true); PropertySuppressionStrategy pss = new PropertySuppressionStrategy() { public boolean suppressProperty(Class clazz, Class type, String name) { if (clazz == com.xxx.yyy.zzz) return true; else return false; } }; introConfig.setPropertySuppressionStrategy(pss); beanWriter.getBindingConfiguration().setMapIDs(false); beanWriter.enablePrettyPrint(); beanWriter.write(this); ... ... ------------------------------------------------------------------Server details--------------------------------------------------------------------------------------------------------------------------------------------- WebSphere Platform 5.1 [ND 5.1.1.11 cf110622.05] [JDK 1.4.2.5 pj9ap32142-20060428] [BASE 5.1.1.11 cf110622.05] running with process name SSE01_CELL\SSE01_w93\BRIT_APP_w93 and process id 749774 Host Operating System is AIX, version 5.2 Java version = J2RE 1.4.2 IBM AIX build ca142-20060421 (SR5) (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM was.install.root = /usr/WebSphere/SSEServer01 user.install.root = /usr/WebSphere/SSEServer01 Java Home = /usr/WebSphere/SSEServer01/java/jre ws.ext.dirs = /usr/WebSphere/SSEServer01/java/lib:/usr/WebSphere/SSEServer01/classes:/usr/WebSphere/SSEServer01/classes:/usr/WebSphere/SSEServer01/lib:/usr/WebSphere/SSEServer01/lib/ext:/usr/WebSphere/SSEServer01/web/help:/usr/WebSphere/SSEServer01/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime Classpath = /usr/WebSphere/SSEServer01/properties:/usr/WebSphere/SSEServer01/properties:/usr/WebSphere/SSEServer01/lib/bootstrap.jar:/usr/WebSphere/SSEServer01/lib/j2ee.jar:/usr/WebSphere/SSEServer01/lib/lmproxy.jar:/usr/WebSphere/SSEServer01/lib/urlprotocols.jar Java Library path = /usr/WebSphere/SSEServer01/java/jre/bin:/usr/WebSphere/SSEServer01/java/jre/bin/classic:/usr/WebSphere/SSEServer01/java/jre/bin:/usr/WebSphere/SSEServer01/bin:/usr/mqm/java/lib:/usr/opt/wemps/lib:/opt/fitb/db2/db2rtcl/sqllib/lib:/usr/lib --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sailesh Rao Brokerage IT - 5/3 Bank MD 1MOB2B 513-358-1599 This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the addressee(s) named above. If you receive this e-mail in error, please do not read, copy or disseminate it in any manner. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this information is prohibited. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please erase it from your computer system. Your assistance in correcting this error is appreciated.