• Community
  • Products
  • Clover
  • Questions
  • Using the eclipse plugin while running my application I get, "Caused by: java.lang.ClassNotFoundException: com_cenqua_clover.CoverageRecorder"

Using the eclipse plugin while running my application I get, "Caused by: java.lang.ClassNotFoundException: com_cenqua_clover.CoverageRecorder"

One of the plugins I am trying to get codecoverage on fails to load. It errors as in the question. The application is running but without some of its functions working. I do see the CLOVER_RUNTIME in the classpath of the project. How do I resolve this?

Full stacktrace:

Caused by: java.lang.ClassNotFoundException: com_cenqua_clover.CoverageRecorder
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)

3 answers

1 accepted

Disable clover on the project(s). Do clean and build project(s). Again enable clover on project(s) and try to launch it. it worked for me.

A clean re-installation of eclipse, clover and my projects resolved the issue. The specific error above occurred because I never got a "run with clover" toolbaritem, so I was trying to use standard run and debug configurations. I had gotten the clover explorer and other clover views, but not the run with clover. Since I had not used clover for sometime I had forgotten about it.

Thanks for you response. If someone else runs into this, I would recommend that you confirm you are using a clover run configuration. I would also confirm that your .project and .classpath have the proper clover attributes added. There are docs on the specifics for these entries.

I get the same ClassNotFoundException running the automatically configured Clover build from Bamboo 3.2.1. It's a multimodule build and Bamboo is running the command:

/home/eufxcadm/apache-maven-3.0.3/bin/mvn -Djava.io.tmpdir=/tmp/CORENIGHTLY-JOB1 -U -B clean deploy clean com.atlassian.maven.plugins::maven-clover2-plugin:setup verify com.atlassian.maven.plugins::maven-clover2-plugin:aggregate com.atlassian.maven.plugins::maven-clover2-plugin:clover -Dmaven.clover.generateJson=false -Dmaven.clover.licenseLocation=/core/.clover/clover.license

0 vote

Hi,

Clover-for-Eclipse: @Ken: Make sure that you're using "Run with Clover as..." instead of "Run as..." in Eclipse. Alternatively, if you can't use this option (you want to use Debug/Profile for instance) then add the Clover runtime jar to Xbootclasspath. See Instrumenting+RCP+Application.

Clover-for-Maven: @David: I guess that your Maven build deploys some jars to application server and runs tests there (typical for integration tests) or runs in-container tests. If this is the case, make sure that you have 'com.cenqua.clover:clover' on your <dependencies> list. Alternatively, put clover.jar into application server /lib directory or add it to CLASSPATH during server startup.

Regards
Marek

Suggest an answer

Log in or Join to answer
Community showcase
Emilee Spencer
Published Friday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

56 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
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