6.9.11 throws NoClassDefFoundError when running test in Intellij 15

5,624 views
Skip to first unread message

Nagesh

unread,
Apr 1, 2016, 4:08:06 PM4/1/16
to testng-users
I upgraded my project from 6.9.9 to 6.9.11. Running a test in Intellij with 6.9.9 proceeded without errors. But now when I run my test from Intellij with 6.9.11 I get the following error immediately -

Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/remote/RemoteArgs
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.testng.remote.RemoteArgs
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 6 more

When I run from command line with 6.9.11 I don't encounter this problem. 

Do I need to update anything else on my end (besides changing the pom) to make it work with Intellij? Anybody else seeing this issue?

Nagesh

unread,
Apr 4, 2016, 4:17:58 PM4/4/16
to testng-users
Can somebody confirm if 6.9.11 is working on *any* version of Intellij. Greatly appreciate your feedback.

⇜Krishnan Mahadevan⇝

unread,
Apr 4, 2016, 11:58:48 PM4/4/16
to testng...@googlegroups.com
Nagesh,

I can't seem to recreate your problem. Am running on IntelliJ 2016.1 with TestNG version 6.9.11

Code:
public class SampleTestNG {
@Test
public void testMethod() {
String loc = TestNG.class.getProtectionDomain().getCodeSource().getLocation().toExternalForm();
System.err.println("Using TestNG version :" + new File(loc).getParentFile().getName());
}
}

Output:
[TestNG] Running:
  /Users/krmahadevan/Library/Caches/IntelliJIdea2016.1/temp-testng-customsuite.xml
Using TestNG version :6.9.11

===============================================
Default Suite
Total tests run: 1, Failures: 0, Skips: 0
===============================================


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Julien Herr

unread,
Apr 5, 2016, 11:44:15 AM4/5/16
to testng-users
It is a IntelliJ issue which is fixed in latest releases: https://youtrack.jetbrains.com/issue/IDEA-150806

Nagesh

unread,
Apr 5, 2016, 1:57:51 PM4/5/16
to testng-users
Hi Krishnan - Thank you for letting me know it works with the 2016 version.

Julien - Thank you for pointing me to the fix which provided some insight into the issue. I was indeed on a build (15.0.5 - 143.x) that did not have the fix.

I am on 2016.1.1 now and I am able to run tests in the IDE.
Reply all
Reply to author
Forward
0 new messages