【发布时间】:2018-02-14 08:03:32
【问题描述】:
我正在尝试使用 Spring boot cxf starter 发布服务,使用 Databinding xmlbean,如下所示:
@Bean
public Endpoint nameServiceEndpoint() {
EndpointImpl endpoint = new EndpointImpl(bus, new NameWsServiceImpl());
endpoint.publish("/NamesWsService");
endpoint.setDataBinding(new XmlBeansDataBinding());
return endpoint;
}
当我尝试运行应用程序时出现以下错误:
java.lang.NoSuchMethodError: org.apache.cxf.common.jaxb.JAXBUtils.createMininumEscapeHandler
在我的 pom 中,我有依赖项:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-xmlbeans</artifactId>
<version>3.1.14</version>
</dependency>
我该如何解决这个问题?
【问题讨论】:
-
如果解决方案好请投票
-
感谢您的回复,我已经将您的回复标记为已解决
-
为什么要混用不同的 CXF 版本?您应该对所有 CXF 依赖项使用相同的版本。
标签: java spring maven spring-boot cxf