gpt4 book ai didi

java - CustomEditorConfigurer 的 customEditors 属性与 RangeArrayPropertyEditor、Spring 4.3.3 与 Spring Batch 3.0.7

转载 作者:太空宇宙 更新时间:2023-11-04 12:05:49 24 4
gpt4 key购买 nike

我将 Spring 4.3.3 与 Spring Batch 3.0.7 一起使用并收到此异常:

Caused by: org.springframework.beans.TypeMismatchException: Failed to
convert property value of type [java.util.LinkedHashMap] to required
type [java.util.Map] for property 'customEditors'; nested exception
is java.lang.IllegalArgumentException: Cannot convert value of type
[org.springframework.batch.item.file.transform.RangeArrayPropertyEditor]
to required type [java.lang.Class] for property 'customEditors[org.springframework.batch.item.file.transform.Range[]]':
PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor]
returned inappropriate value of type
[org.springframework.batch.item.file.transform.RangeArrayPropertyEditor]

代码:

<bean id="customEditorConfigurer"
class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="org.springframework.batch.item.file.transform.Range[]">
<bean
class="org.springframework.batch.item.file.transform.RangeArrayPropertyEditor" />
</entry>
</map>
</property>
</bean>

最佳答案

试试这个:

<bean id="customEditorConfigurer"
class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="org.springframework.batch.item.file.transform.Range[]" value="org.springframework.batch.item.file.transform.RangeArrayPropertyEditor"/>
</map>
</property>

关于java - CustomEditorConfigurer 的 customEditors 属性与 RangeArrayPropertyEditor、Spring 4.3.3 与 Spring Batch 3.0.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40381999/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com