I lost a day struggling with this Java error. I had been trying to parse a XML document in a Java web application. It had worked in previous deployments so I knew the code was sound. But when I deployed the WAR file onto my Tomcat6 server on Ubuntu Linux 9.10 I hit an obscure error I had not encountered before.
Apache Commons Digester was throwing an error when it tried to load a XML parser.
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null" at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:448) at org.apache.commons.digester.Digester.getFactory(Digester.java:534)
This caused another exception in turn:
I tried everything: switching parsers from xerces to crimson; running tomcat with different JVMs; overriding classloaders; all to no avail. Finally I came upon a blog post which revealed that “[the] message This parser does not support specification “null” version “null” [is] the secret. That’s the default error message of the XML parser if you turn on XInclude but that isn’t a supported feature.”
The reason for the UnsupportedOperationException error was that the XML parser implementation I was using did not support the features Commons Digester was trying to set on it. I upgraded my version of xercesImpl.jar from 2.6.2 to 2.9.1, restarted tomcat, and the problem was solved!