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:
Digester.getParser: NullPointerException
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!
This is exactly the same error I got. Your posting helped me much. thanks for saving my day!
Comment by Satish — March 5, 2010 @ 7:38 pm
Thank you for your blog entry, and even more for the concise statement of “I upgraded my version of xercesImpl.jar from 2.6.2 to 2.9.1”. This was exactly what I have been looking for, and has solved my problem.
Comment by Eric Enright — May 8, 2010 @ 5:49 am
Your posting helped me much… God bless you…
Comment by Deepak kumar modi — May 14, 2010 @ 9:52 am
http://forums.oracle.com/forums/thread.jspa?messageID=4339351#4339351
Comment by faruk — June 3, 2010 @ 8:46 am
Same problem!! same solution!!!
Comment by Mario García — March 1, 2011 @ 10:48 pm
Thank you ! This concise note regarding the problem and it’s solution helped me at a critical testing phase of my work!
Comment by aks — June 14, 2011 @ 11:19 pm
very usefull post, thanks
Comment by v — November 11, 2011 @ 6:19 am
Hey thank U so much…. perfectly worked for me….
Comment by Naresh — June 4, 2012 @ 6:03 am
Thank you so much… it worked for me too
Comment by anonymous — November 20, 2012 @ 6:51 am
Thank you …………..this post is very usefull……………….
Comment by Alankar — January 11, 2013 @ 6:26 am
One more link I’ve just found on this topic:
https://coderwall.com/p/kqsrrw
Comment by Odo — January 28, 2013 @ 1:20 pm
thanks! solved the issue
Comment by endeios — February 18, 2013 @ 2:35 pm
THANK YOU!! Thought I was going mad
Comment by Carmen — November 27, 2013 @ 9:34 pm
THANK YOU!!!! That saved my day!
Comment by nauni77 — November 1, 2014 @ 8:04 pm
THANK YOU!! Save me a lot of time
Comment by Alexandre Chatiron — April 13, 2015 @ 5:23 am