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 Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

332 views 0 12
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot