Resolve SAXNotRecognizedException

  java

Order

Wsdl call in java8, reporting an error SAXNotRecognizedException.

Error message

org.xml.sax.SAXNotRecognizedException: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.

Reason

Several XML-parser were loaded, but the wrong parser was used. java8 preferred JAXB instead of the conflict caused by COM.Sun.XML.Internal.Bind.V2.Util.xMFactory.

Solve

<dependency>
    <groupId>xerces</groupId>
    <artifactId>xercesImpl</artifactId>
    <version>2.11.0</version>
</dependency>

Add this at the beginning of the pom file to ensure that it is loaded first.

doc