Hi:
I am trying to
marshall an object and unmarshall the resulting string using the same mapping
file.
Getting
this error:
#startElement:
trans:pricing-result
#startElement: trans:base-rates
unable to find FieldDescriptor for 'base-rates' in ClassDescriptor of pricing-result - ignoring extra element.
#startElement: price-code
#endElement: price-code
#endElement: trans:base-rates
#startElement: trans:base-rates
unable to find FieldDescriptor for 'base-rates' in ClassDescriptor of pricing-result - ignoring extra element.
#startElement: price-code
#endElement: price-code
#endElement: trans:base-rates
Mapping
file extract:
<class name="com.mhub.ppe.PricingResult"
auto-complete="false">
<description>Default mapping for class com.mhub.ppe.PricingResult</description>
<map-to xml="pricing-result" ns-uri="http://www.mortgagehub.com/schemas/trans" ns-prefix="trans"/>
<field name="baseRates" type="com.mhub.ppe.Rate" collection="array">
<bind-xml name="base-rates" node="element"/>
</field>
</class>
<description>Default mapping for class com.mhub.ppe.PricingResult</description>
<map-to xml="pricing-result" ns-uri="http://www.mortgagehub.com/schemas/trans" ns-prefix="trans"/>
<field name="baseRates" type="com.mhub.ppe.Rate" collection="array">
<bind-xml name="base-rates" node="element"/>
</field>
</class>
<class name="com.mhub.ppe.Rate"
auto-complete="false">
<description>Default mapping for class com.mhub.ppe.Rate</description>
<map-to xml="rate" ns-uri="http://www.mortgagehub.com/schemas/trans" ns-prefix="trans"/>
<field name="productId" type="long" required="false" direct="false" transient="false">
<bind-xml name="product-id" node="attribute"/>
</field>
<field name="rateId" type="long" required="false" direct="false" transient="false">
<bind-xml name="rate-id" node="attribute"/>
</field>
<field name="baseRateId" type="long" required="false" direct="false" transient="false">
<bind-xml name="base-rate-id" node="attribute"/>
</field>
<field name="interestRate" type="double" required="false" direct="false" transient="false">
<bind-xml name="interest-rate" node="attribute"/>
</field>
<field name="margin" type="double" required="false" direct="false" transient="false">
<bind-xml name="margin" node="attribute"/>
</field>
<field name="price" type="double" required="false" direct="false" transient="false">
<bind-xml name="price" node="attribute"/>
</field>
<field name="srp" type="double" required="false" direct="false" transient="false">
<bind-xml name="srp" node="attribute"/>
</field>
<field name="apr" type="double" required="false" direct="false" transient="false">
<bind-xml name="apr" node="attribute"/>
</field>
<field name="finalPrice" type="double" required="false" direct="false" transient="false">
<bind-xml name="final-price" node="attribute"/>
</field>
<field name="pricePlusSrp" type="double" required="false" direct="false" transient="false">
<bind-xml name="price-plus-srp" node="attribute"/>
</field>
<field name="priceCode" type="string" required="false" direct="false" transient="false">
<bind-xml name="price-code" node="element"/>
</field>
</class>
<description>Default mapping for class com.mhub.ppe.Rate</description>
<map-to xml="rate" ns-uri="http://www.mortgagehub.com/schemas/trans" ns-prefix="trans"/>
<field name="productId" type="long" required="false" direct="false" transient="false">
<bind-xml name="product-id" node="attribute"/>
</field>
<field name="rateId" type="long" required="false" direct="false" transient="false">
<bind-xml name="rate-id" node="attribute"/>
</field>
<field name="baseRateId" type="long" required="false" direct="false" transient="false">
<bind-xml name="base-rate-id" node="attribute"/>
</field>
<field name="interestRate" type="double" required="false" direct="false" transient="false">
<bind-xml name="interest-rate" node="attribute"/>
</field>
<field name="margin" type="double" required="false" direct="false" transient="false">
<bind-xml name="margin" node="attribute"/>
</field>
<field name="price" type="double" required="false" direct="false" transient="false">
<bind-xml name="price" node="attribute"/>
</field>
<field name="srp" type="double" required="false" direct="false" transient="false">
<bind-xml name="srp" node="attribute"/>
</field>
<field name="apr" type="double" required="false" direct="false" transient="false">
<bind-xml name="apr" node="attribute"/>
</field>
<field name="finalPrice" type="double" required="false" direct="false" transient="false">
<bind-xml name="final-price" node="attribute"/>
</field>
<field name="pricePlusSrp" type="double" required="false" direct="false" transient="false">
<bind-xml name="price-plus-srp" node="attribute"/>
</field>
<field name="priceCode" type="string" required="false" direct="false" transient="false">
<bind-xml name="price-code" node="element"/>
</field>
</class>
Class
file:
public class
PricingResult implements java.io.Serializable {
private Rate[] baseRates = null;
private Rate[] baseRates = null;
public Rate[] getBaseRates() {
return baseRates;
}
return baseRates;
}
public void setBaseRates(Rate[] baseRates)
{
this.baseRates = baseRates;
}
}
this.baseRates = baseRates;
}
}
XML
generated:
<trans:pricing-result><trans:base-rates
product-id="42" rate-id="377110" base-rate-id="0" interest-rate="5.5"
margin="0.0" price="4.25" srp="-0.75" apr="0.0" final-price="3.5"
price-plus-srp="3.5"><price-code>WC20040603102457</price-code></trans:base-rates></trans:pricing-result>
Am I missing
something.. Please help!!
-Bhaskar
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
