Thanks, Philipp. Now if all of this information was to be copied to a new Jira issue, that would be greatly appreciated.
Werner -------- Original-Nachricht -------- Datum: Tue, 08 May 2007 15:16:51 +0200 Von: Philipp Reichart <[EMAIL PROTECTED]> An: [email protected] Betreff: Re: [castor-user] [XML] Castor shouldn\'t require set-methods > Hi Werner, > > I didn't mention this yet, so for the record, I'm using Castor 1.1. > > > I'll need that exact stack trace, as it would provide me with clues as > > to where I shall make the required changes. > > Here you go: > > -- > org.exolab.castor.mapping.MappingException: The method setCountryInfos > in class x.y.z.ReportData accepting/returning object of type class > [Lx.y.z.AggregatedCountryInfoInterface; was not found > at > org.exolab.castor.mapping.loader.AbstractMappingLoader.createFieldHandler(AbstractMappingLoader.java:693) > at > org.exolab.castor.mapping.loader.AbstractMappingLoader.createFieldDesc(AbstractMappingLoader.java:478) > at > org.exolab.castor.xml.XMLMappingLoader.createFieldDesc(XMLMappingLoader.java:444) > at > org.exolab.castor.mapping.loader.AbstractMappingLoader.createFieldDescriptors(AbstractMappingLoader.java:320) > at > org.exolab.castor.xml.XMLMappingLoader.createClassDescriptor(XMLMappingLoader.java:215) > at > org.exolab.castor.mapping.loader.AbstractMappingLoader.createClassDescriptors(AbstractMappingLoader.java:180) > at > org.exolab.castor.xml.XMLMappingLoader.loadMapping(XMLMappingLoader.java:159) > at > org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:132) > at > org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:99) > at org.exolab.castor.xml.Marshaller.setMapping(Marshaller.java:557) > [stacktrace continues within our own code] > -- > > For completeness, here's how I call Castor: > > -- > Mapping mapping = new Mapping(); > mapping.loadMapping(resource); > > FileWriter out = new FileWriter(INPUT_FILE); > > Marshaller marshaller = new Marshaller(out); > marshaller.setMapping(mapping); // this throws the exception > marshaller.marshal(data); > > out.close(); > -- > > And here's part of the mapping file: > > -- > <class > name="x.y.z.AggregatedCountryInfoInterface" > extends="x.y.z.AggregatedInfoInterface" > verify-constructable="false"> > <field name="countryName"> > <bind-xml node="attribute" /> > </field> > <field name="countryIsoCode"> > <bind-xml node="attribute" /> > </field> > <field name="period" transient="true" /> > </class> > <class > name="x.y.z.AggregatedCountryInfo" > extends="x.y.z.AggregatedCountryInfoInterface"> > <map-to xml="country" /> > </class> > -- > > Something like a verify-settable or readonly attribute (true|false) for > the <field> tag would be nice. > > Thanks in advance, > Philipp Reichart > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email -- "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email

