Dariusz on Software Quality & Performance

23/06/2010

ConfigurationException: XML-22101: (Fatal Error) DOMSource node as this type not supported

Filed under: en — Tags: — dariusz.cieslak @

When you setup your project with commons-configuration library plugged in sometimes you can get very misleading error:

ConfigurationException: XML-22101: (Fatal Error) DOMSource node as this type not supported

This error may be caused by missing XML library bindings. In order to fix that error you have to configure properly some service providers (point JVM to correct XML parsing/transformation implementations).

How to do that? You have to create the following directory structure somewhere under classpath:

  • META-INF
  • META-INF/services
  • META-INF/services/interface_name_files

Then inside "services" directory place filenames named after interfaces and filled with full class name of an implementation, for example (Xerces + Xalan plugged in):

  • src/META-INF/services/javax.xml.parsers.DocumentBuilderFactory
    • org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
  • src/META-INF/services/javax.xml.parsers.SAXParserFactory
    • org.apache.xerces.jaxp.SAXParserFactoryImpl
  • src/META-INF/services/javax.xml.transform.TransformerFactory
    • org.apache.xalan.processor.TransformerFactoryImpl

After this change proper XML implementation should be used (if the jar is present on classpatch of course).

5 Comments »

  1. Funny, this is the 2nd time I arrive at your blog while Googling for a BPH issue ;)

    Comment by Fokko Groenenboom — 25/01/2011 @

  2. Indeed, but at the moment expect no new posts on that AFAIR ;-)

    Comment by prad — 17/02/2011 @

  3. We had this issue on one of our Weblogic Deployment. The issue was resolved by simply restarting JVM on the node. We were not able to root cause the issue tough.

    Comment by Narendra Yanamadala — 30/03/2012 @

  4. Probably you've changed configuration but JVM was not restarted after that change. New configuration has been loaded after restart and that's why error is no more visible.

    Comment by dariusz.cieslak — 30/03/2012 @

  5. Hi,
    For me, the error happened occasionally, sometimes happen and sometimes not.
    Did you ever experience issue like that?

    Comment by Agung — 05/02/2013 @

RSS feed for comments on this post. TrackBack URL

Leave a comment


× 5 = forty five

Powered by WordPress