天天看點

de.hybris.platform.servicelayer.dto.converter.ConversionException

錯誤消息:

de.hybris.platform.servicelayer.dto.converter.ConversionException: Max field set size exceeded. Reason of that can be : too generic configuration, lack of properly defined BASIC field set level for data class, reccurency in data structure

這個錯誤消息和 handling ‘fields’ parameter 有關。

文檔:

https://help.hybris.com/6.7.0/hcd/8c404c5886691014a48c88f4a49f9bf3.html Section ‘Fields configuration’, ‘Field Set Builder’ : https://help.hybris.com/6.7.0/hcd/e571a0e6f7524d4ab62e29cc2b387aeb.html

Mapping mechanism in occ is based on Orika mapper.

There is additional filter which check if currently mapped attribute is on the list of attributes which should be mapped. That list is created based on class definition and fieldSetLevelMappings by fieldSetBuilder (defined in dto-level-mappings-v2-spring.xml)

occ 中的映射機制基于 Orika 映射器。

還有一個額外的過濾器,用于檢查目前映射的屬性是否在應該映射的屬性清單中。 該清單是根據 fieldSetBuilder(在 dto-level-mappings-v2-spring.xml 中定義)的類定義和 fieldSetLevelMappings 建立的。

<alias alias="fieldSetBuilder" name="defaultFieldSetBuilder"/>
     <bean id="defaultFieldSetBuilder"
           class="de.hybris.platform.webservicescommons.mapping.impl.DefaultFieldSetBuilder">
         <property name="defaultRecurrencyLevel" value="4"/>
         <property name="defaultMaxFieldSetSize" value="50000"/>
         <property name="fieldSetLevelHelper" ref="fieldSetLevelHelper"/>
     </bean>      

There are two parameters which can influence how the field set builder works :

defaultRecurrencyLevel

defaultMaxFieldSetSize - If the limit is exceeded, an exception is thrown - this is exception you see.

It looks like for request you try to do - response dto is too complex

Verify if fieldsSetMapping for that dto class was defined properly.

If you don’t specify any fields attribute in request - value is taken from DEFAULT fieldSetLevelMapping.

Try to specify fields attribute for your call and verify if you still get that exception.

有兩個參數可以影響字段集建構器的工作方式:

defaultMaxFieldSetSize - 如果超出限制,則會引發異常 - 這是您看到的異常。

看起來您嘗試執行的請求 - 響應 dto 太複雜了

驗證是否正确定義了該 dto 類的 fieldsSetMapping。

如果您未在請求中指定任何字段屬性 - 值取自 DEFAULT fieldSetLevelMapping。

嘗試為您的呼叫指定 fields 屬性并驗證您是否仍然遇到該異常。

繼續閱讀