今天用springboot2.x写了个webservice的接口
启动项目后报错:
class not found EmbeddedServletContainerAutoConfiguration
分析
pom.xml文件中的依赖如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<!-- CXF webservice -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.1.16</version>
</dependency>
<!-- CXF webservice -->
cxf-spring-boot-starter-jaxws 版本低了 升级版本
解决
<!-- CXF webservice -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.2.6</version>
</dependency>
<!-- CXF webservice -->
org.apache.cxf的依赖版本改到3.2.6,重新编译就好了