commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b p <trashspam2...@yahoo.com>
Subject [betwixt]: Cycles cause StackOverflowError when registering bean
Date Tue, 13 Jan 2004 19:38:48 GMT
Hi, 
 
I have been investigating Betwixt and run into an issue with cycles.  I have 3 beans with
a cycle:
A->-B
B->C
C->A
 
I'm able to generate XML successfully, but not read it.  When I call BeanReader.registerBeanClass(A)
I get a StackOverflowError (printed below).  If I take out the cycle, it works fine.  I performed
the test using the binary distribution 20040113.

Does betwixt support cycles?  If so, is there something specific I need to do to avoid what
appears to be a recursive infinite loop?  

Thanks in advance,

Brian

java.lang.StackOverflowError
 at java.lang.Object.hashCode(Native Method)
 at java.util.HashMap.hash(HashMap.java:261)
 at java.util.HashMap.get(HashMap.java:317)
 at org.apache.commons.betwixt.registry.DefaultXMLBeanInfoRegistry.get(DefaultXMLBeanInfoRegistry.java:88)
 at org.apache.commons.betwixt.XMLIntrospector.introspect(XMLIntrospector.java:326)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.getElementDescriptor(BeanRuleSet.java:448)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addChildRules(BeanRuleSet.java:307)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addRule(BeanRuleSet.java:515)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addRule(BeanRuleSet.java:495)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addChildRules(BeanRuleSet.java:402)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addRule(BeanRuleSet.java:515)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addRule(BeanRuleSet.java:495)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addChildRules(BeanRuleSet.java:402)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addRule(BeanRuleSet.java:515)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addRule(BeanRuleSet.java:495)
 at org.apache.commons.betwixt.io.BeanRuleSet$ReadingContext.addChildRules(BeanRuleSet.java:402)
...



---------------------------------
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message