Hi Anuj,
If your element "Button" needs to appear more than once, you need to
mark it as a collection.
For example:
<class name="Foo">
<field name="Button" collection="vector"
set-method="addButton" get-method="getButtons"/>
</class>
--Keith
"Sharma Anut (external)" wrote:
>
> Hi,Guys
>
> Wud appreciate if someone can provide some info on this...I guess this
> problem has been solved in version 0.9.5.2 (maybe am missing something but
> am stuck on it for a while)
>
> Thanx in advance!
>
> Anuj
>
> > -----Original Message-----
> > From: Sharma Anut (external)
> > Sent: 21 November 2003 08:49
> > To: [EMAIL PROTECTED]
> > Subject: Element occurs more than once
> >
> >
> > Hi,
> >
> > I am a newbie to castor and am getting this exception.
> > I have created my own Data Objects and then created a Mapping File.
> > But on trying to execute I get this exception.
> > Would appreciate if someone could provide some info on -
> > Also attached my files for reference if required...
> >
> > D:\source\Mgr\Feeder>java GetHugeButton
> > Inside Exception
> > ValidationException: element "Button" occurs more than once.
> > (XMLFieldDesciptor: FeederButton AS Button)
> > at
> > org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:80
> > 2)
> > at
> > org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:91
> > 8)
> > at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
> > Source)
> > at
> > org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
> > Source)
> > at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> > Source)
> > at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispa
> > tcher.dispatch(Unknown Sou
> > at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > Source)
> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
> > Source)
> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> > Source)
> > at
> > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:583)
> > at GetHugeButton.main(GetHugeButton.java:25)
> >
> >
> > <<GUI_Config_Feeder.xml>> <<mapping_feeder.xml>> <<ButtonParent.java>>
> > <<FeederButtonsTop.java>> <<FeederButtonsBot.java>>
> > <<FeederButtons.java>> <<FeederButton.java>> <<GetHugeButton.java>>
> >
> > Mit freundlichen Gr��en / kind regards
> > Anuj Sharma
> >
> >
> >
> >
>
> ------------------------------------------------------------------------
> Name: GUI_Config_Feeder.xml
> GUI_Config_Feeder.xml Type: XML Document (text/xml)
> Encoding: quoted-printable
>
> Name: mapping_feeder.xml
> mapping_feeder.xml Type: XML Document (text/xml)
> Encoding: quoted-printable
>
> ButtonParent.javaName: ButtonParent.java
> Type: VisualCafe File
> (application/x-unknown-content-type-VisualCafeFile.Document)
>
> FeederButtonsTop.javaName: FeederButtonsTop.java
> Type: VisualCafe File
> (application/x-unknown-content-type-VisualCafeFile.Document)
>
> FeederButtonsBot.javaName: FeederButtonsBot.java
> Type: VisualCafe File
> (application/x-unknown-content-type-VisualCafeFile.Document)
>
> FeederButtons.javaName: FeederButtons.java
> Type: VisualCafe File
> (application/x-unknown-content-type-VisualCafeFile.Document)
>
> FeederButton.javaName: FeederButton.java
> Type: VisualCafe File
> (application/x-unknown-content-type-VisualCafeFile.Document)
>
> GetHugeButton.javaName: GetHugeButton.java
> Type: VisualCafe File
> (application/x-unknown-content-type-VisualCafeFile.Document)
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev