The springboot integration CXF calls WebService and reports an error: cannot create a secure xmlinputfactory

The springboot integration CXF calls WebService and reports an error:

javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory。

As shown below:

The final reason is that wstx-asl-3.2.6.jar package is introduced into the project. This package is the same as many classes of woodstox-core-asl-4.4.1.jar, resulting in jar package conflict.

Solution steps:

  1. View Maven dependencies:

mvn dependency:tree

  Package structure comparison:

2. Maven dependency excludes wstx-asl-3.2.6.jar package dependency

Find the location where the dependency is introduced and exclude wstx ASL:

 

  Reference document: WebService problem, urgent- CSDN forum WebService problem, urgent!!! https://bbs.csdn.net/topics/390491260

Read More: