이상한 것 ...JiBXException : 클래스에 대해 정의 된 다중 바인딩
바인딩 정의 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>
다음은이 바인딩 정의 user-composite-entity.xml (상위 파일에 포함)입니다.
<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>
이제 바인딩 user-wrapper.xml을 사용하는 REST를 호출하면 매핑이 성공적으로 완료됩니다. 바인딩 user-composite-entity.xml을 사용하는 REST를 호출하면 다음 오류가 발생합니다.
org.jibx.runtime.JiBXException: Multiple bindings defined for class UserCompositeEntity
이제는 이상한 점이 있습니다. user-wrapper.xml에서 제거하면 <include path="user-composite-entity.xml" />
은 다음과 같이됩니다. - user-composite-entity.xml을 사용한 호출은 succes, - user-wrapper.xml과 함께 호출됩니다.
org.jibx.runtime.JiBXException: No marshaller defined for class UserCompositeEntity
Google을 사용하는 방법을 알고 있습니다.) JiBX는 각 바인딩의 모든 클래스를 컴파일하므로 여러 바인딩에서 동일한 클래스가있는 경우 JiBX가 모두이를 컴파일합니다. 방금 user-wrapper.xml에서 user-composite-entity.xml로 모든 것을 옮길 필요가있었습니다. – Trick
일부 세부 정보로 대답하고 대답으로 선택하면 StackOverflow에서 참조 될 수 있습니다. – elhoim