SAXNotRecognizedException, while Unmarshalling XML Input Stream

I encounter this exception while trying to unmount the input XML data stream. This seems to be a problem with the Xerces library, but it's hard for me to find a solution to this. I am running a Java EE program with EclipseLink on a Glassfish server with Java 8. This error occurs in my REST service, which takes an XML input stream as a parameter. The error I am getting is:

Caused by: java.lang.IllegalStateException: org.xml.sax.SAXNotRecognizedException: unrecognized feature http://javax.xml.XMLConstants/feature/secure-processing at com.sun.xml.bind.v2.util.XmlFactory.createParserFactory(XmlFactory.java:135) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(UnmarshallerImpl.java:154) at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:172) at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:219) 

I saw other questions posted here, suggesting that I update the Xerces library that I use and that it is the highest dependency, so Maven grabs this one, not some other library, but it hasn't been developed by me yet. Relevant part of my POM file:

 <dependencies> <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.11.0</version> </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>2.22.2</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> </exclusion> <exclusion> <groupId>xerces</groupId> <artifactId>xerces</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.0.2.GA</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.primefaces</groupId> <artifactId>primefaces</artifactId> <version>6.0</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.10</version> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.6</version> </dependency> <dependency> <groupId>org.dom4j</groupId> <artifactId>dom4j</artifactId> <version>2.0.0-RC1</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>19.0</version> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.9.2</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.14</version> </dependency> <dependency> <groupId>org.apache.xmlbeans</groupId> <artifactId>xmlbeans</artifactId> <version>2.6.0</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-csv</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.core</artifactId> <version>2.5.2</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>3.0.6.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>3.0.6.RELEASE</version> </dependency> <dependency> <groupId>org.passay</groupId> <artifactId>passay</artifactId> <version>1.2.0</version> </dependency> <dependency> <groupId>org.apache.openejb</groupId> <artifactId>openejb-api</artifactId> <version>4.7.4</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>1.10.19</version> <scope>test</scope> </dependency> <dependency> <groupId>main.java.com.exavault</groupId> <artifactId>evapi</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.glassfish.jersey.security</groupId> <artifactId>oauth1-client</artifactId> <version>2.25</version> </dependency> <dependency> <groupId>com.force.api</groupId> <artifactId>force-wsc</artifactId> <version>39.0.0</version> </dependency> <dependency> <groupId>org.mindrot</groupId> <artifactId>jbcrypt</artifactId> <version>0.3m</version> </dependency> </dependencies> 

The only thing I can think of that still causing the problem is that something uses the Xerces library, but I cannot find anything in the dependencies that use it. Also, I originally used xercesImpl version 2.0.2 and xerces 2.0.2 before using xercesImpl 2.11.0, although this did not seem to help get rid of this error.

+5
source share

Source: https://habr.com/ru/post/1264901/


All Articles