Thanks a lot. I am sure we'll be looking at this in due time. Werner
jvleminc wrote: > I have just created a Jira issue: > http://jira.codehaus.org/browse/CASTOR-1919 > http://jira.codehaus.org/browse/CASTOR-1919 . Personally, it isn't urgent, > since my workaround satisfies me, but it remains an annoying bugger ;-) Good > luck with it! > > Joris > > > > Werner Guttmann wrote: >> Very hard to diagnose. Can you PLEASE create a new Jira issue and attach >> *all* relevant files ? >> >> Werner >> >> jvleminc wrote: >>> I managed to risolve this error by using the following mapping file. >>> <?xml version="1.0"?> >>> <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" >>> "http://castor.exolab.org/mapping.dtd"> >>> <mapping> >>> <description>Mapping per il file dei dati di test verso una lista di >>> TestDatabean</description> >>> >>> <class >>> name="it.aci.tabelleComuni.normalizzatoreResidenze.junit.bean.TestDataList"> >>> <field name="list" collection="arraylist" >>> type="it.aci.tabelleComuni.normalizzatoreResidenze.junit.bean.TestDataBean"> >>> <bind-xml name="test"/> >>> </field> >>> </class> >>> >>> <class >>> name="it.aci.tabelleComuni.normalizzatoreResidenze.junit.bean.TestDataBean"> >>> <field name="inputBean" >>> type="it.aci.tabelleComuni.normalizzatoreResidenze.bean.InputBean" >>> container="true"> >>> </field> >>> <field name="id" type="int"> >>> <bind-xml name="id" node="element"/> >>> </field> >>> <field name="comuneEsito" type="int"> >>> <bind-xml name="comuneEsito" node="element"/> >>> </field> >>> <field name="comuneElaborazione" type="int"> >>> <bind-xml name="comuneElaborazione" node="element"/> >>> </field> >>> <field name="localitaEsito" type="int"> >>> <bind-xml name="localitaEsito" node="element"/> >>> </field> >>> <field name="localitaElaborazione" type="int"> >>> <bind-xml name="localitaElaborazione" node="element"/> >>> </field> >>> <field name="indirizzoEsito" type="int"> >>> <bind-xml name="indirizzoEsito" node="element"/> >>> </field> >>> <field name="indirizzoElaborazione" type="int"> >>> <bind-xml name="indirizzoElaborazione" node="element"/> >>> </field> >>> </class> >>> >>> <class >>> name="it.aci.tabelleComuni.normalizzatoreResidenze.bean.InputBean"> >>> <field name="codiceProvincia" type="string"/> >>> <field name="descrizioneComune" type="string"/> >>> <field name="descrizioneLocalita" type="string"/> >>> <field name="cap" type="string"/> >>> <field name="descrizioneDug" type="string"/> >>> <field name="indirizzoString" type="string"/> >>> <field name="civico" type="string"/> >>> <field name="comuneTipoCodifica" type="int"/> >>> <field name="indirizzoTipoCodifica" type="int"/> >>> </class> >>> >>> >>> </mapping> >>> >>> Note the "container" attribute, which isn't documented in the official >>> documentation >>> (http://www.castor.org/xml-mapping.html#3.4-The-<field>-element) but in >>> this >>> case saved my life! >>> Now I have just another new annoying error, about which I find little >>> help >>> online. I get the following error when I execute my program: >>> The container object >>> (it.aci.tabelleComuni.normalizzatoreResidenze.bean.InputBean) cannot >>> accept >>> the child object associated with the element 'comuneTipoCodifica' because >>> the container is already full!{file: [not available]; line: 13; column: >>> 22} >>> >>> Any ideas??? If I eliminate the comuneTipoCodifica and >>> indirizzoTipoCodifica >>> fields from my data file, everything works fine. >>> Thanks in advance! >>> >>> >>> >>> jvleminc wrote: >>>> Hello, >>>> >>>> I am having the following problem with a Castor XML->bean mapping. I >>>> don't >>>> manage to group a series of xml fields >>>> into a bean. Let me explain. >>>> The bean to be filled: TestDataBean.java >>>> public class TestDataBean extends BaseBean { >>>> private int id; >>>> private InputBean inputBean; >>>> >>>> private int comuneEsito; >>>> private int comuneElaborazione; >>>> private int localitaEsito; >>>> private int localitaElaborazione; >>>> private int indirizzoEsito; >>>> private int indirizzoElaborazione; >>>> /* getter + setter */ >>>> } >>>> >>>> where InputBean.java: >>>> public class InputBean extends >>>> it.aci.tabelleComuni.normalizzatoreResidenze.utils.BaseBean { >>>> private java.lang.String cap; >>>> private java.lang.String civico; >>>> private java.lang.String descrizioneComune; >>>> private java.lang.String descrizioneDug; >>>> private java.lang.String descrizioneLocalita; >>>> private java.lang.String indirizzoString; >>>> private java.lang.String codiceProvincia; >>>> private int comuneTipoCodifica; >>>> private int indirizzoTipoCodifica; >>>> /* getter + setter*/ >>>> } >>>> >>>> My input file xml: >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <dataroot xmlns:od="urn:schemas-microsoft-com:officedata"> >>>> <test> >>>> <id>1</id> >>>> <comuneElaborazione>101</comuneElaborazione> >>>> <comuneEsito>100</comuneEsito> >>>> <localitaElaborazione>980</localitaElaborazione> >>>> <localitaEsito>900</localitaEsito> >>>> <indirizzoElaborazione>980</indirizzoElaborazione> >>>> <indirizzoEsito>900</indirizzoEsito> >>>> <codiceProvincia>AR</codiceProvincia> >>>> <descrizioneComune>CIVITELLA IN VAL DI CHIANA</descrizioneComune> >>>> <comuneTipoCodifica>999</comuneTipoCodifica> >>>> <indirizzoTipoCodifica>999</indirizzoTipoCodifica> >>>> </test> >>>> <!-- more tests --> >>>> </dataroot> >>>> >>>> I want the fields that are not *Esito or *Elaborazione (such as >>>> codiceProvincia or descrizioneComune) to fill the InputBean, inside the >>>> TestDataBean, but whatever I try, I get a (correct) "unable to find >>>> FieldDescriptor for 'codiceProvincia' in ClassDescriptor of >>>> test-data-bean" error. >>>> My current mapping file is this one: >>>> <mapping> >>>> <description>Mapping per il file dei dati di test verso una lista di >>>> TestDatabean</description> >>>> >>>> <class >>>> name="it.aci.tabelleComuni.normalizzatoreResidenze.junit.bean.TestDataList"> >>>> <field name="list" collection="arraylist" >>>> type="it.aci.tabelleComuni.normalizzatoreResidenze.junit.bean.TestDataBean"> >>>> <bind-xml name="test"/> >>>> </field> >>>> </class> >>>> >>>> <class >>>> name="it.aci.tabelleComuni.normalizzatoreResidenze.junit.bean.TestDataBean"> >>>> <field name="id" type="int"> >>>> <bind-xml name="id" node="element"/> >>>> </field> >>>> <field name="comuneEsito" type="int"> >>>> <bind-xml name="comuneEsito" node="element"/> >>>> </field> >>>> <field name="comuneElaborazione" type="int"> >>>> <bind-xml name="comuneElaborazione" node="element"/> >>>> </field> >>>> <field name="localitaEsito" type="int"> >>>> <bind-xml name="localitaEsito" node="element"/> >>>> </field> >>>> <field name="localitaElaborazione" type="int"> >>>> <bind-xml name="localitaElaborazione" node="element"/> >>>> </field> >>>> <field name="indirizzoEsito" type="int"> >>>> <bind-xml name="indirizzoEsito" node="element"/> >>>> </field> >>>> <field name="indirizzoElaborazione" type="int"> >>>> <bind-xml name="indirizzoElaborazione" node="element"/> >>>> </field> >>>> </class> >>>> >>>> <class >>>> name="it.aci.tabelleComuni.normalizzatoreResidenze.bean.InputBean"> >>>> <field name="codiceProvincia" type="string"/> >>>> <field name="descrizioneComune" type="string"/> >>>> <field name="descrizioneLocalita" type="string"/> >>>> <field name="cap" type="string"/> >>>> <field name="descrizioneDug" type="string"/> >>>> <field name="indirizzoString" type="string"/> >>>> <field name="civico" type="string"/> >>>> <field name="comuneTipoCodifica" type="integer"/> >>>> <field name="indirizzoTipoCodifica" type="integer"/> >>>> </class> >>>> >>>> </mapping> >>>> >>>> It seems in need some inverse "collection" atribute somewhere inside my >>>> mapping, but I don't know how to indicate that several root fields have >>>> to >>>> be grouped into a sub-bean. >>>> >>>> Any help is appreciated! Thanks in advance. >>>> >>>> Joris >>>> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email

