【问题标题】:SoapVersion conversion with Spring Framework 4使用 Spring Framework 4 进行 SoapVersion 转换
【发布时间】: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

标签: java spring soap


【解决方案1】:

spring 配置 文件中您需要更改 xsd 版本来解决问题

【讨论】:

  • 感谢您的评论。我所有的spring配置xml都有正确的版本-4.3.xml
猜你喜欢
  • 2016-02-04
  • 2015-05-01
  • 2014-01-25
  • 2021-01-04
  • 2017-06-23
  • 1970-01-01
  • 1970-01-01
  • 2015-12-12
  • 1970-01-01
相关资源
最近更新 更多