TestNG: Classnotfoundexception (at runtime) - for class existing in project

I have a peculiar problem that I see on Idea 9.0.2 (but not on 9.0.1) .. I have a project consisting of two modules:
   1. application (depends on util) - built using ant (with some code generation)
   2. util (built using maven)

I'm trying to run a TestNG unit test residing in the application module... and I get a classnotfoundexception looking something like the following:

java.lang.NoClassDefFoundError: path/to/package/in/util/module/SnmpRunner
 at bogus.package.name.beforeTest(ClassNameRenamedTest.java:38)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:644)
 at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:443)
 at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:160)

The class that TestNG complains about is in the classpath.. Moreover, this test runs without an issue in 9.0.1... So I don't know what's going on.



Please sign in to leave a comment.