English 中文(简体)
JiBXException: Multi bindings下定义的等级
原标题:JiBXException: Multiple bindings defined for class
  • 时间:2009-10-20 13:25:54
  •  标签:

奇怪的事情

我有一个具有约束力的定义,用户-强奸手。

<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>

下一步 我有这一具有约束力的定义,用户-供应商资格。

<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>

现在,如果我称之为使用具有约束力的用户-治疗器.xml的REST,那么绘图工作就会成功进行。 如果我称之为具有约束性用户同业资格的科学知识与技术,我就会发现下一个错误:

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
最佳回答

现在如何工作: 我不会再有用户-每秒。

<binding>
 <include path="core-wrapper.xml" />
 <include path="core-composite-entity.xml" />
 <include path="user-entity.xml" />

 <mapping name="users" class="UserWrapper" extends="CoreWrapper">
  <structure map-as="CoreWrapper" usage="optional" />
  <collection field="users" usage="optional" >   
  </collection>
 </mapping>

 <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>

问题在于,在我之前,用户-wrapper.xml(包括用户-供应商-供应商-实体-xml)和JiBX(为用户-wrapper.xml)再次汇编。 为什么有多种具有约束力的定义......

问题回答




相关问题
热门标签