title: Solution for secure-processing org.xml.sax.SAXNotRecognizedException causing java.lang.IllegalStateException running inside Tomcat
body: <p>I'm facing this exception when receiving an Xml and trying to parse it. The code responsible for that is well tested when running as an standalone application. However I'm now integrating it in Tomcat.</p>
  
  <p>The stack trace is:</p>
  
  <pre><code>java.lang.IllegalStateException: org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
      at com.sun.xml.internal.bind.v2.util.XmlFactory.createParserFactory(XmlFactory.java:121)
      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(UnmarshallerImpl.java:139)
      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:204)
  </code></pre>
  
  <p>Digging around I found <a href="http://tomcat.10.x6.nabble.com/tomcat-7-in-ubuntu-td5003226.html#a5003250" rel="noreferrer">this</a>, so maybe the solution is to change the options Tomcat sets.</p>
  
  <p>So the question is:</p>
  
  <ul>
  <li>Which is the problem's root?</li>
  <li>Best way to solve it?</li>
  <li>Is a good approach to change Tomcat options? how is this done?</li>
  </ul>
  
  <p><em>Update</em></p>
  
  <p>This happens when running it with Java 8, reverting to Java 7 works ok.</p>