Jan,
reference="true" is allowable on the field element, it was a bug in the version of Castor that you are using that made it have no effect, the CVS version correctly handles this. --Keith Jan Ploski wrote: > > On Fri, 20 Sep 2002 20:22:37 +0200 I wrote: > > > On Wed, 18 Sep 2002 12:42:54 -0700 Ate Douma wrote: > > > See bug #1005 (http://bugzilla.exolab.org/show_bug.cgi?id=1005) JDO > > > example not working. Ik did run into the same problem and found a > > > workaround which I did report on bug #1005. > > > > ...regarding a bug in the JDO example Test.java, resulting in a stack > > trace like: > > > > > Exception in thread "main" java.lang.StackOverflowError > > > at java.lang.FloatingDecimal.dtoa(FloatingDecimal.java:515) > > > at java.lang.FloatingDecimal.<init>(FloatingDecimal.java:502) > > > at java.lang.Float.toString(Float.java:138) > > > at java.lang.String.valueOf(String.java:2308) > > > at java.lang.Float.toString(Float.java:306) > > > at >org.exolab.castor.xml.handlers.EnumFieldHandler.getValue(EnumFieldHandler.java:150) > > > at >org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:191) > > > at >org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:844) > > > at org.exolab.castor.xml.Validator.validate(Validator.java:118) > > > at >org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:251) > > > at >org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:844) > > ... > > > > The suggested workaround (adding attribute reference="true" to > > <field name="product" type="myapp.Product">) does not work for me. > > I am still getting the same StackOverflowError. Tested against > > 0.9.3.21 binary and the current CVS snapshot. Any ideas? > > Hello, > > It turns out I misunderstood the advice: "By setting the xml subelement > for the product field its reference attribute to "true" this loop is > prevented." As cited above, being a Castor newbie, I added reference="true" > to the "field" element, rather than its subelement "xml". > This had absolutely no effect. > > I consider it a (minor) bug in Castor: why does it not complain at all > about adding an arbitrary attribute to an arbitrary element in mapping.xml?) > And, if there is a way to turn on stricter validation, why is it not turned > on by default? You can imagine how long it takes a newcomer to find out > the cause of such a stupid problem by tracing Castor's source code. > > Regards - > Jan Ploski > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
