• 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

0 votes
Accepted answer

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 votes

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 Sign up to answer
Community showcase
Asked Dec 06, 2018 in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

5,531 views 21 17
View question

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