Error > Missing com/codahale/metrics/JmxReporter class

(rahat) #1

I am getting some errors while trying to run following example:

Error is saying - java.lang.NoClassDefFoundError: com/codahale/metrics/JmxReporter
And I can see, JmxReporter class is actually missing inside metrics-core-4.0.3.jar
but Metrics class of cassandra driver ( cassandra-driver-core-3.6.0.jar) is calling it.
This maybe related to cassandra plugins.

any tips how to fix this issue ?



cassandra Plugins:

{cassandraPluginVersion}</version> </dependency> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-persistence-cassandra-launcher_2.12</artifactId> <version>{cassandraPluginVersion}


20:12:28.261 [] INFO a.c.Cluster(akka://ClusterSystem) - Cluster Node [akka.tcp://ClusterSystem@] - Welcome from [akka.tcp://ClusterSystem@]
Uncaught error from thread [Uncaught error from thread [ClusterSystem-cassandra-plugin-default-dispatcher-25]: com/codahale/metrics/JmxReporter, shutting down JVM since ‘akka.jvm-exit-on-fatal-error’ is enabled for ActorSystem[ClusterSystem]
ClusterSystem-cassandra-plugin-default-dispatcher-26]: com/codahale/metrics/JmxReporter, shutting down JVM since ‘akka.jvm-exit-on-fatal-error’ is enabled for ActorSystem[ClusterSystem]
java.lang.NoClassDefFoundError: com/codahale/metrics/JmxReporter
at com.datastax.driver.core.Metrics.(
at com.datastax.driver.core.Cluster$Manager.init(
at com.datastax.driver.core.Cluster.init(
at com.datastax.driver.core.Cluster.connectAsync(
at com.datastax.driver.core.Cluster.connectAsync(
at akka.persistence.cassandra.ConfigSessionProvider.$anonfun$connect$1(ConfigSessionProvider.scala:49)
at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:303)
at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(

(rahat) #2

I had raise an issue below:

Response for the issue is below:
we are trying to maintain compatibility with Metrics 3.x so we don’t break existing users. We do support Metrics 4.x, however for it to work you will need to make some adjustments, covered in Metrics 4 Compatibility.

The next major version of the java driver (4.0) will use metrics 4.

Which means, need to follow below recommendation:

But I am just using,

is that mean, CassandraLauncher need to be updated ?

(Tim Moore) #3

@rahat the example you pointed to is an sbt project, but it looks from your post like you are running a Maven project. Is that right? Did you author the pom.xml yourself? Could you post a link to that?

The example runs correctly when I follow the instructions on the page, and it’s using metrics-core-3.2.2.jar. I think the simplest solution will be to try to get your project closer to the example, so try to find out why it’s using metrics-core-4.0.3.jar. You could use the mvn dependency:tree command to see what is bringing in the newer version.

Have you added Cinnamon to your project? That does depend on Metrics 4 by default. You can switch it back go Metrics 3 by following the instructions at

(rahat) #4

Hi Tim Moore,

Thanks a lot for your response. After reading your response, I just added metrics-core-3.2.2.jar dependency manually to see what happens, and issue disappeared and demo app started working !!


However, I didn’t add any cinnamon dependency, but I created the initial project from spring initializr, and spring-boot-maven-plugin is still there, not sure if that was causing the issue!