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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 7 hours ago in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

21 views 0 3
Read article

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