7 comments
Comment actions Permalink

Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/TestNG
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:117)
Caused by: java.lang.ClassNotFoundException: org.testng.TestNG
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 13 more
Disconnected from the target VM, address: '127.0.0.1:36165', transport: 'socket'

Process finished with exit code 1

0
Comment actions Permalink

I get the above stack trace whenever I try to run a test within IntelliJ.  I've tried everything, from obliterating intellij and starting from scratch, to creating a new project, to explicitly adding the TestNG dependency (I believe) to the project.

0
Comment actions Permalink

Please share a project that would reproduce this problem (this project should include all the required dependencies).

0
Comment actions Permalink

I can't exactly share my entire codebase.  Do you guys have any possible triage steps you can share with me?

0
Comment actions Permalink

Share any new dummy project with similar configuration and testng dependency. From the error it looks like TestNG jar is missing from the module dependencies or is corrupt. See http://www.jetbrains.com/idea/webhelp/configuring-module-dependencies-and-libraries.html.

0
Comment actions Permalink

Here's what seems to be happening.

When I import an maven project, the library folders that it generates end up in /home/bross/bin/idea-15/${HOME}/.m2/repository/.

This is clearly wrong.  Do you have any idea why this would happen?

0
Comment actions Permalink

Figured it out.  I modified my ~/.m2/settings.xml to explicitly define the path to the local maven repository, rather than use ${HOME}/.m2/repository, and reimported my project.

0

Please sign in to leave a comment.