title: SAXNotRecognizedException While Unmarshalling XML Input Stream
body: <p>I'm running into this exception while trying to unmarshall an input stream of XML data.  This is apparently a problem with the Xerces library, but I'm having a hard time figuring out a solution to this.  I'm running a Java EE program with EclipseLink on a Glassfish Server with Java 8.  This error occurs in my REST service that takes an XML input stream as a parameter.  The error I get is:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>I've seen other questions posted here suggesting to upgrade the Xerces library I'm using and to have it be the upper most dependency so Maven grabs that one instead of some other library , but it hasn't worked out yet for me.  The relevant part of my POM file is:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xerces&lt;/groupId&gt;
          &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
          &lt;version&gt;2.11.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
          &lt;version&gt;7.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-container-servlet&lt;/artifactId&gt;
          &lt;version&gt;2.22.2&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;xerces&lt;/groupId&gt;
                  &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;xerces&lt;/groupId&gt;
                  &lt;artifactId&gt;xerces&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;version&gt;4.0.2.GA&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
          &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
          &lt;version&gt;6.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-io&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
          &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
          &lt;version&gt;1.3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-codec&lt;/groupId&gt;
          &lt;artifactId&gt;commons-codec&lt;/artifactId&gt;
          &lt;version&gt;1.10&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-lang&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.dom4j&lt;/groupId&gt;
          &lt;artifactId&gt;dom4j&lt;/artifactId&gt;
          &lt;version&gt;2.0.0-RC1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
          &lt;artifactId&gt;guava&lt;/artifactId&gt;
          &lt;version&gt;19.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;joda-time&lt;/groupId&gt;
          &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
          &lt;version&gt;2.9.2&lt;/version&gt;
      &lt;/dependency&gt;       
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
          &lt;version&gt;3.14&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.xmlbeans&lt;/groupId&gt;
          &lt;artifactId&gt;xmlbeans&lt;/artifactId&gt;
          &lt;version&gt;2.6.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-csv&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.core&lt;/artifactId&gt;
          &lt;version&gt;2.5.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;3.0.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;version&gt;3.0.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;       
      &lt;dependency&gt;
          &lt;groupId&gt;org.passay&lt;/groupId&gt;
          &lt;artifactId&gt;passay&lt;/artifactId&gt;
          &lt;version&gt;1.2.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.openejb&lt;/groupId&gt;
          &lt;artifactId&gt;openejb-api&lt;/artifactId&gt;
          &lt;version&gt;4.7.4&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
          &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
          &lt;version&gt;1.10.19&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;main.java.com.exavault&lt;/groupId&gt;
          &lt;artifactId&gt;evapi&lt;/artifactId&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.security&lt;/groupId&gt;
          &lt;artifactId&gt;oauth1-client&lt;/artifactId&gt;
          &lt;version&gt;2.25&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.force.api&lt;/groupId&gt;
          &lt;artifactId&gt;force-wsc&lt;/artifactId&gt;
          &lt;version&gt;39.0.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mindrot&lt;/groupId&gt;
          &lt;artifactId&gt;jbcrypt&lt;/artifactId&gt;
          &lt;version&gt;0.3m&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>The only thing I can think of that's still causing the problem is that something is using a Xerces library still, but I can't find anything in the dependencies that are using it.  Also, I originally had been using xercesImpl version 2.0.2 and xerces 2.0.2 before using xercesImpl 2.11.0, though that didn't seem to help get rid of this error.</p>