java.lang.NoClassDefFoundError: org/testng/TestNG

Apache's JIRA Issue Tracker | Mikhail Mazurskiy | 4 years ago
  1. 0

    This happens sometimes (rarely). 2.14, 14.1 are affected and earlier versions too I think. The setting is: - parallel build, - surefire and failsafe are forked always. Is there anything more I can provide to help debug this? {noformat} [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test (default-test) on project PROJECT: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test failed: There was an error in the forked process [ERROR] java.lang.NoClassDefFoundError: org/testng/TestNG [ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:64) [ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:189) [ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:105) [ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:117) [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ERROR] at java.lang.reflect.Method.invoke(Method.java:601) [ERROR] at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208) [ERROR] at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159) [ERROR] at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95) [ERROR] Caused by: java.lang.ClassNotFoundException: org.testng.TestNG [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:423) [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:356) [ERROR] at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:97) [ERROR] ... 13 more {noformat}

    Apache's JIRA Issue Tracker | 4 years ago | Mikhail Mazurskiy
    java.lang.NoClassDefFoundError: org/testng/TestNG
  2. 0

    Cucumber-junit 1.1.3 cannot find class Examples

    GitHub | 4 years ago | danielkwinsor
    java.lang.RuntimeException: java.lang.ClassNotFoundException: Examples:
  3. 0

    Maven Surefire plugin throwing class not found exception for EclipseStarter

    Stack Overflow | 2 years ago
    java.lang.NoClassDefFoundError: org/eclipse/core/runtime/adaptor/EclipseStarter
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    scalatest 1.0 not work for scala 2.8.0.Beta1

    Google Groups | 7 years ago | Ford Guo
    java.lang.NoClassDefFoundError: scala/List
  6. 0

    Maven - Users - mvn install: Failure executing javac, but could not parse error

    nabble.com | 1 year ago
    java.lang.NoClassDefFoundError: org/junit/runner/notification/RunListener

  1. andyglick 2 times, last 4 days ago
  2. richard77 1 times, last 7 days ago
  3. musketyr 2 times, last 7 days ago
  4. michallos 2 times, last 7 days ago
  5. batwalrus76 2 times, last 1 week ago
67 more registered users
28 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    org.testng.TestNG

    at java.net.URLClassLoader$1.run()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    2. java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    3. java.security.AccessController.doPrivileged(Native Method)
    4. java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    5. java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    6. java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    6 frames
  3. SureFire
    IsolatedClassLoader.loadClass
    1. org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:97)
    1 frame
  4. org.apache.maven
    TestNGProvider.invoke
    1. org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:64)
    2. org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:189)
    3. org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:105)
    4. org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:117)
    4 frames
  5. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:601)
    4 frames
  6. SureFire
    ForkedBooter.main
    1. org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
    2. org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
    3. org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
    4. org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    5. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
    5 frames