Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

java.lang.NoClassDefFoundError when using clover + ant to generate the code coverage

Star Chen September 1, 2011

Hi,

I used clover 3.0.2 + ant to generate the code coverage for our project, however, I got following exception:

[junit] Running oracle.kv.impl.api.ops.MultiKeyTest
[junit] Testsuite: oracle.kv.impl.api.ops.MultiKeyTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 11.477 sec
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 11.477 sec
[junit]
[junit] Testcase: testAll took 11.465 sec
[junit] Caused an ERROR
[junit] oracle/kv/impl/util/CommonLoggerUtils$__CLR3_0_27ia7iags3lwk7p
[junit] java.lang.NoClassDefFoundError: oracle/kv/impl/util/CommonLoggerUtils$__CLR3_0_27ia7iags3lwk7p
[junit] at oracle.kv.impl.util.CommonLoggerUtils.getLoggerProperty(CommonLoggerUtils.java:22)
[junit] at oracle.kv.util.ConsoleHandler.<init>(ConsoleHandler.java:40)
[junit] at oracle.kv.impl.util.client.ClientLoggerUtils.getLogger(ClientLoggerUtils.java:26)
[junit] at oracle.kv.KVStoreFactory.getStore(KVStoreFactory.java:45)
[junit] at oracle.kv.impl.api.ops.ClientTestBase.setUp(ClientTestBase.java:37)
[junit] Caused by: java.lang.ClassNotFoundException: oracle.kv.impl.util.CommonLoggerUtils$__CLR3_0_27ia7iags3lwk7p
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[junit] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
[junit]
[junit] Test oracle.kv.impl.api.ops.MultiKeyTest FAILED

If I do not use the clover and run the test programs, there is not such exception. Could you please show me the reason? And how should I solved this problem?

Thanks very much.

Jane

1 answer

0 votes
Ronald Brindl September 7, 2011

My first guess to this problem would be that you do not have clover.jar in your classpath when running the instrumented code.

The second (more complicated) possibility is, that somehow the embedded clover class cannot be initialized. I experienced such a case when clovering code that itself does runtime bytecode instrumentation and so run into some kind of endless loops.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events