(sorry if this is a duplicate- the
last send apparently failed)
Hello-
I may have found a
potential bug. When unmarshalling the test XML doc below, I
receive the following error:
1)
testMapping(FoodMappingTest)java.lang.NoClassDefFoundError: Saltyfood (wrong
name: SaltyFood)
at java.lang.ClassLoader.defineClass0(Native Method)
----------------
at java.lang.ClassLoader.defineClass0(Native Method)
----------------
Here is the test XML
doc and the corresponding mapping file:
----------------
<thefoods>
<saltyfood name="beef jerky"/>
<sweetfood name="candy"/>
<spicyfood name="chili peppers"/>
</thefoods>
<saltyfood name="beef jerky"/>
<sweetfood name="candy"/>
<spicyfood name="chili peppers"/>
</thefoods>
----------------
<mapping>
<class name="FoodTypes">
<map-to xml="thefoods"/>
<field name="foods" type="Food" collection="arraylist">
<bind-xml auto-naming="deriveByClass" node="element"/>
</field>
</class>
<class name="SaltyFood">
<map-to xml="saltyfood"/>
<field name="name" type="java.lang.String">
<bind-xml name="name" node="attribute"/>
</field>
</class>
<class name="FoodTypes">
<map-to xml="thefoods"/>
<field name="foods" type="Food" collection="arraylist">
<bind-xml auto-naming="deriveByClass" node="element"/>
</field>
</class>
<class name="SaltyFood">
<map-to xml="saltyfood"/>
<field name="name" type="java.lang.String">
<bind-xml name="name" node="attribute"/>
</field>
</class>
<class name="SpicyFood">
<map-to xml="spicyfood"/>
<field name="name" type="java.lang.String">
<bind-xml name="name" node="attribute"/>
</field>
</class>
<map-to xml="spicyfood"/>
<field name="name" type="java.lang.String">
<bind-xml name="name" node="attribute"/>
</field>
</class>
<class name="SweetFood">
<map-to xml="sweetfood"/>
<field name="name" type="java.lang.String">
<bind-xml name="name" node="attribute"/>
</field>
</class>
</mapping>
<map-to xml="sweetfood"/>
<field name="name" type="java.lang.String">
<bind-xml name="name" node="attribute"/>
</field>
</class>
</mapping>
-------------------------------
I won't include the
java classes here, since you can infer there are 3 concrete classes implementing
the 'Food' interface. Notice that the java class names are the same as the
element names, except for capitalization.
*******Note that
when I change the element names to something that is spelled different (like
sweetfud), it works perfectly.
Thank
you,
Brent
Picasso
