Search code examples
javaxmlunit

XMLUnit - ClassNotFoundException


I just downloaded XMLUnit (https://github.com/xmlunit/xmlunit/releases) but can't get it to work.

When I tried to configure some properties like:

        XMLUnit.setControlParser("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
        XMLUnit.setTestParser("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
        XMLUnit.setSAXParserFactory("org.apache.xerces.jaxp.SAXParserFactoryImpl");
        XMLUnit.setTransformerFactory("org.apache.xalan.processor.TransformerFactoryImpl");

... the follow exception is thrown:

java.lang.ClassNotFoundException: No ClassLoaders found for: org.custommonkey.xmlunit.XMLUnit
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)

Anyone else had this same issue?


Solution

  • I assume you are using a jboss application server. I think you just did not include all libraries in you jar / war / ear file.