【发布时间】:2017-05-22 14:23:40
【问题描述】:
我正在将我的代码从 Spring 3 移动到 4。我遇到了这个异常:
java.lang.IllegalArgumentException: Cannot convert value of type [org.apache.cxf.binding.soap.SoapVersionPropertyEditor] to required type [java.lang.Class] for property 'customEditors[org.apache.cxf.binding.soap.SoapVersion]': PropertyEditor [org.springframework.beans.propertyeditors.ClassEditor] returned inappropriate value of type [org.apache.cxf.binding.soap.SoapVersionPropertyEditor] at ...
我用这个answer 写了以下内容,但这并不能解决我的问题。
在我的servlet.xml 文件中我添加了:
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<list>
<bean class="com.company.CustomEditor"/>
</list>
</property>
</bean>
我在我的项目中添加了这个类:
public class CustomEditor implements PropertyEditorRegistrar {
@Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
registry.registerCustomEditor(SoapVersion.class, new SoapPropertyEditor());
}
}
如何解决 Spring 4 中的 soapVersion 问题?
我是春天的新手。
谢谢
【问题讨论】:
-
问题可能是兼容性问题。我的 apache cxf 版本是 2.0,我使用的是 Spring 框架 4