Dariusz on Software

Methods and Tools

About This Site

Software development stuff

Archive

ConfigurationException: XML-22101: (Fatal Error) DOMSource node as this type not supported
Wed, 23 Jun 2010 07:54:31 +0000

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).

Tags: java.

Tags

Created by Chronicle v3.5