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

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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

121 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you