在spring boot整合CXF开发是遇到的一些问题
以及整合方式
整合过程
Spring boot 整合CXF开发web servicejava
网上资料引入cxf-spring-boot-starter-jaxws依赖便可
<dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-spring-boot-starter-jaxws</artifactId> <version>3.1.11</version> </dependency>
成功集成cxf后,发现只有webservice服务能够正常使用,其余请求url所有没法正常访问。web
而后在cxf 配置文件中spring
WebServiceCxfCfg.javaapache
更改此方法名:ide
public ServletRegistrationBean dispatcherServlet()
@Bean public ServletRegistrationBean disServlet(){ return new ServletRegistrationBean(new CXFServlet() , "/services/*"); }
便可成功访问其余urlspring-boot
是由于 public ServletRegistrationBean dispatcherServlet() 把默认映射覆盖掉了,把这个名字改掉,控制类方法就能访问了。url
更改此方法明后能够正常其余请求url,webservice服务也正常。spa
出处:https://blog.csdn.net/hawako/article/details/80556676.net