I get the following error: 
unable to find FieldDescriptor for 'Address' in ClassDescriptor of Result 

Its probably my fault, but for the life of me I can't see it. 

Below is the source xsd which was passed to sourcegen, and the mapping file produced 
from the resultant java classes. 

The error is quite right, the Address is missing from the Result class. Sourcegen has 
generated an _addressList which is a vector, but this is not picked up by the mapping 
tool. If I manually add the field to the mapping file it still complains.

I can only surmise that the java classes are not being generated properly. 

Ideas anyone ? 

Thanx 

Andrew 

==================================================================== 
<?xml version="1.0" encoding="UTF-8"?> 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified" 
attributeFormDefault="unqualified"> 
<xs:complexType name="CompassFlexSearchResultList"> 
<xs:sequence> 
<xs:element name="Result" minOccurs="0" maxOccurs="unbounded"> 
<xs:complexType> 
<xs:sequence> 
<xs:element name="Citizen" type="CompassCitizenIDType" minOccurs="0" 
maxOccurs="unbounded"/> 
<xs:element name="Address" type="CompassKeyType" minOccurs="0" maxOccurs="unbounded"/> 
</xs:sequence> 
<xs:attribute name="score" type="xs:float" use="required"/> 
</xs:complexType> 
</xs:element> 
</xs:sequence> 
<xs:attribute name="number_of_results_returned" type="xs:long" use="required"/> 
<xs:attribute name="total_results" type="xs:long" use="required"/> 
</xs:complexType> 
<xs:simpleType name="CompassCitizenIDType"> 
<xs:restriction base="xs:long"> 
<xs:minInclusive value="1"/> 
</xs:restriction> 
</xs:simpleType> 
<xs:simpleType name="CompassKeyType"> 
<xs:restriction base="xs:long"/> 
</xs:simpleType> 
<xs:element name="b8CompassFlexSearchResultList" type="CompassFlexSearchResultList"/> 
</xs:schema> 

================================================================= 

Mapping file 


<?xml version="1.0" encoding="UTF-8"?> 
<mapping> 
<class name="B8CompassFlexSearchResultList" auto-complete="false"> 
<description>Default mapping for class B8CompassFlexSearchResultList</description> 
<map-to xml="b8CompassFlexSearchResultList"/> 
<field name="total_results" type="long" required="false" 
direct="false" transient="false"> 
<bind-xml name="total_results" node="attribute"/> 
</field> 
<field name="number_of_results_returned" type="long" 
required="false" direct="false" transient="false"> 
<bind-xml name="number_of_results_returned" node="attribute"/> 
</field> 
<field name="result" type="Result" required="false" 
direct="false" transient="false" collection="array"> 
<bind-xml name="result" node="element"/> 
</field> 
</class> 
<class name="Result" auto-complete="false"> 
<description>Default mapping for class Result</description> 
<map-to xml="Result"/> 
<field name="score" type="float" required="false" direct="false" transient="false"> 
<bind-xml name="score" node="attribute"/> 
</field> 
</class> 
</mapping> 

==============================================================
Amended mapping file for Result which also does not work

    <class name="Result" auto-complete="false">
        <description>Default mapping for class Result</description>
        <map-to xml="Result"/>
        <field name="score" type="float" required="false" direct="false" 
transient="false">
            <bind-xml name="score" node="attribute"/>
        </field>
        <field name="_addressList" 
            collection="array" type="long" 
            required="false" 
            direct="false" 
            get-method="getAddress"
            set-method="addAddress"            
            transient="false">
            <bind-xml name="Address" node="attribute"/>
        </field>

    </class>


___________________________________
NOCC, http://nocc.sourceforge.net

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to