很感谢这位作者的文章https://blog.youkuaiyun.com/q340505050518/article/details/105394315
近期对项目版本进行升级
原项目版本
从 Springcloud alibaba 2.1.0 Spring cloud Greenwich SpringBoot 2.1.3版本升级,
一开始升级的版本是:
Springcloud alibaba 2.2.0.RELEASE Spring cloud Hoxton.SR1 SpringBoot 2.3.0
但是此时其他测试无问题,以为一切顺利
但是在一次webservice调用外部服务时,发现调用失败,抛出如下异常:
org.apache.cxf.common.jaxb.JAXBUtils.createMininumEscapeHandler(Ljava/...
后来经过百度,以及CXF官网FAQ 可能遇到问题解决办法
初步判断为springboot 版本和CXF版本不匹配导致,认为Springboot版本较高
选择降低版本
调整架构版本为
Springcloud alibaba 2.2.1.RELEASE Spring cloud Hoxton.SR3 SpringBoot 2.2.5.RELEASE
CXF版本选择为使用最多的3.2.4版本
并对原CXF 3.2.4版本中的core包进行exclusion
如下:
<!-- webService-->
<!-- cxf框架依赖 -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>${cxf-spring-boot-starter-jaxws.version}</version>
<exclusions>
<exclusion>
<artifactId>cxf-core</artifactId>
<groupId>org.apache.cxf</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>3.2.6</version>
</dependency>