how do i solve this? " java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder "

I am testing code instrumentation on web app(contains servlet).I am using maven(with clover plugin) for build this.I compiled and deployed without errors.But when try to open HelloWorld servlet on server.I had this error:

org.apache.catalina.core.StandardWrapperValve invoke

SEVERE: Servlet.service() for servlet [HelloWorld] in context with path [/my-webapp-clover] threw exception [Servlet execution threw an exception] with root cause

java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder

at com.yapikredi.app.HelloWorld.doGet(HelloWorld.java:14)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

thanks in advance

2 answers

1 accepted

3 votes
Answer accepted

It is looking for clover jar at runtime it seems.

Do I need to configurate classpath

Ideally, it shouldn't be needed at runtime but try adding it in classpath and see if it works. I don't know why clover is required during runtime!

I am new at this how do i do this ? pls can you give a walkthrough

Thanks to you i solved it.

I add .classpath file to web app in server.This classpath point to clover.jar(WEB-INF\lib\clover.jar).

Then re-run server.

0 votes

See also this KB article.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Opsgenie

Getting the Most out of Atlassian and Opsgenie Together

We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...

68 views 0 1
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