0

When I try and run testng tests on a project, I am getting this exception:

    -------------------------------------------------------
     T E S T S
    -------------------------------------------------------
    Running TestSuite

    Results :

    Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5.512s
    [INFO] Finished at: Wed Nov 18 14:45:14 GMT 2015
    [INFO] Final Memory: 21M/213M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14:test (default-test) on project owr: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.14:test failed: There was an error in the forked process
    [ERROR] org.testng.TestNGException:
    [ERROR] Cannot instantiate class com.openet.report.parsers.JMeterJtlParserTest

The test doesn't always fail on JMeterJtlParserTest, it seems to change over each run. Later in the stack trace it has:

    [ERROR] Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
    [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    [ERROR] at java.security.AccessController.doPrivileged(Native Method)
    [ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    [ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

This is my dependency tree:

    [INFO] +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.48.0:test
    [INFO] |  +- org.seleniumhq.selenium:selenium-support:jar:2.48.0:test
    [INFO] |  |  \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.48.0:test
    [INFO] |  |     +- cglib:cglib-nodep:jar:2.1_3:test
    [INFO] |  |     +- com.google.code.gson:gson:jar:2.2.2:test
    [INFO] |  |     +- org.seleniumhq.selenium:selenium-api:jar:2.48.0:test
    [INFO] |  |     +- com.google.guava:guava:jar:14.0.1:test
    [INFO] |  |     +- org.apache.commons:commons-exec:jar:1.3:test
    [INFO] |  |     +- net.java.dev.jna:jna:jar:4.1.0:test
    [INFO] |  |     \- net.java.dev.jna:jna-platform:jar:4.1.0:test
    [INFO] |  +- net.sourceforge.htmlunit:htmlunit:jar:2.18:test
    [INFO] |  |  +- xalan:xalan:jar:2.7.2:test
    [INFO] |  |  |  \- xalan:serializer:jar:2.7.2:test
    [INFO] |  |  +- commons-collections:commons-collections:jar:3.2.1:test
    [INFO] |  |  +- org.apache.commons:commons-lang3:jar:3.0:test
    [INFO] |  |  +- org.apache.httpcomponents:httpmime:jar:4.5:test
    [INFO] |  |  +- commons-codec:commons-codec:jar:1.4:test
    [INFO] |  |  +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.17:test
    [INFO] |  |  +- xerces:xercesImpl:jar:2.11.0:test
    [INFO] |  |  +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:test
    [INFO] |  |  +- net.sourceforge.cssparser:cssparser:jar:0.9.16:test
    [INFO] |  |  |  \- org.w3c.css:sac:jar:1.3:test
    [INFO] |  |  \- org.eclipse.jetty.websocket:websocket-client:jar:9.2.12.v20150709:test
    [INFO] |  |     +- org.eclipse.jetty:jetty-util:jar:9.2.12.v20150709:test
    [INFO] |  |     +- org.eclipse.jetty:jetty-io:jar:9.2.12.v20150709:test
    [INFO] |  |     \- org.eclipse.jetty.websocket:websocket-common:jar:9.2.12.v20150709:test
    [INFO] |  |        \- org.eclipse.jetty.websocket:websocket-api:jar:9.2.12.v20150709:test
    [INFO] |  \- org.apache.httpcomponents:httpclient:jar:4.5:test
    [INFO] |     \- org.apache.httpcomponents:httpcore:jar:4.4.1:test
    [INFO] +- org.apache.commons:commons-math3:jar:3.1.1:compile
    [INFO] +- net.sourceforge.javacsv:javacsv:jar:2.0:compile
    [INFO] +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
    [INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
    [INFO] +- commons-digester:commons-digester:jar:2.1:compile
    [INFO] +- org.xwiki.platform:xwiki-core-xmlrpc-client:jar:3.0.1:compile
    [INFO] |  \- org.codehaus.swizzle:swizzle-confluence:jar:xwiki:1.2-20080419:compile
    [INFO] +- org.apache.ws.commons:ws-commons-util:jar:1.0.1:compile
    [INFO] |  +- junit:junit:jar:4.4:compile
    [INFO] |  \- xml-apis:xml-apis:jar:1.0.b2:compile
    [INFO] +- org.apache.xmlrpc:xmlrpc-client:jar:3.1.3:compile
    [INFO] +- org.apache.xmlrpc:xmlrpc-common:jar:3.1.3:compile
    [INFO] |  \- org.apache.ws.commons.util:ws-commons-util:jar:1.0.2:compile
    [INFO] +- org.xwiki.platform:xwiki-core-xmlrpc-model:jar:3.0:compile
    [INFO] +- org.codehaus.swizzle:swizzle-confluence:jar:1.6.2:compile
    [INFO] |  \- org.sonatype.sisu:sisu-xmlrpc-client:jar:1.0.0:compile
    [INFO] |     +- org.sonatype.sisu:sisu-xmlrpc-common:jar:1.0.0:compile
    [INFO] |     \- com.ning:async-http-client:jar:1.3.3:compile
    [INFO] |        \- org.jboss.netty:netty:jar:3.2.3.Final:compile
    [INFO] +- org.apache.log4j:log4j:jar:1.2.15:compile
    [INFO] +- commons-io:commons-io:jar:2.4:compile
    [INFO] +- org.slf4j:slf4j-api:jar:1.7.5:compile
    [INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.5:runtime
    [INFO] |  \- log4j:log4j:jar:1.2.17:runtime
    [INFO] +- jfree:jfreechart:jar:1.0.13:compile
    [INFO] |  \- jfree:jcommon:jar:1.0.16:compile
    [INFO] +- org.testng:testng:jar:6.3.1:test
    [INFO] |  +- org.beanshell:bsh:jar:2.0b4:test
    [INFO] |  +- com.beust:jcommander:jar:1.12:test
    [INFO] |  \- org.yaml:snakeyaml:jar:1.6:test
    [INFO] \- net.sf.saxon:Saxon-HE:jar:9.6.0-5:compile
eeijlar
  • 1,232
  • 3
  • 20
  • 53
  • 1
    did you look at this question http://stackoverflow.com/questions/10234201/appengine-error-java-lang-noclassdeffounderror-org-w3c-dom-elementtraversal – awsome Nov 18 '15 at 14:57
  • Yes, I cannot change xml-apis version `(xml-apis:xml-apis:jar:1.0.b2)` as it is used by `org.apache.ws.commons:ws-commons-util`, which is in turn used by `org.apache.xmlrpc:xmlrpc-common:jar:3.1.3`. I am using the latest version of xmlrpc-common that I can find.. – eeijlar Nov 18 '15 at 15:14
  • Adding xml-apis to my lib build directory fixed the problem, thanks for your suggestion - I got the answer from that link. – eeijlar Nov 18 '15 at 15:30

0 Answers0