Strange thing...
I have a binding definition user-wrapper.xml:
<binding>
<include path="core-wrapper.xml" />
<include path="user-composite-entity.xml" />
<mapping name="users" class="UserWrapper" extends="CoreWrapper">
<structure map-as="CoreWrapper" usage="optional" />
<collection field="users" usage="optional" item-type="UserCompositeEntity">
</collection>
</mapping>
</binding>
Next I have this binding definition user-composite-entity.xml (included in upper file):
<binding>
<include path="core-composite-entity.xml" />
<include path="user-entity.xml" />
<mapping name="user" class="UserCompositeEntity" extends="CoreCompositeEntity">
<structure map-as="CoreCompositeEntity" />
<structure field="userEntity" usage="optional" />
<structure field="meta" marshaller="UserMetaHashMapper" unmarshaller="UserMetaHashMapper" usage="optional" />
</mapping>
</binding>
Now, if I call REST which uses binding user-wrapper.xml, mapping goes successfully through. If I call REST which uses binding user-composite-entity.xml I get the next error:
org.jibx.runtime.JiBXException: Multiple bindings defined for class UserCompositeEntity
Now the strange thing (for me). If I remove from user-wrapper.xml <include path="user-composite-entity.xml" />
goes a like this:
- call with user-composite-entity.xml is a succes,
- call with user-wrapper.xml I get the error:
org.jibx.runtime.JiBXException: No marshaller defined for class UserCompositeEntity