question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Achilles Junit: NoClassDefFoundError: com/codahale/metrics/JmxReporter

See original GitHub issue

Spring Boot 2.1, Cassandra driver 3.6.0, achilles-junit 6.0.0

I use achilles-junit as embedded Cassandra in spring boot test cases. But after upgrade from Spring boot 2.0 to 2.1 the tests fail with an exception:

java.lang.NoClassDefFoundError: com/codahale/metrics/JmxReporter
	at com.datastax.driver.core.Metrics.<init>(Metrics.java:146)
	at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1501)
	at com.datastax.driver.core.Cluster.init(Cluster.java:208)
	at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:376)
	at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:355)
	at com.datastax.driver.core.Cluster.connect(Cluster.java:305)
	at info.archinnov.achilles.embedded.AchillesInitializer.initializeFromParameters(AchillesInitializer.java:62)
	at info.archinnov.achilles.embedded.CassandraEmbeddedServer.<init>(CassandraEmbeddedServer.java:64)
	at info.archinnov.achilles.embedded.CassandraEmbeddedServerBuilder.buildServer(CassandraEmbeddedServerBuilder.java:535)
	at info.archinnov.achilles.junit.AchillesTestResource.buildServer(AchillesTestResource.java:141)
	at info.archinnov.achilles.junit.AchillesTestResource.<init>(AchillesTestResource.java:118)
	at info.archinnov.achilles.junit.AchillesTestResourceBuilder.build(AchillesTestResourceBuilder.java:216)
	at com.platincoin.gidra.oauth.server.CassandraEmbeddedIntegrationTest.embeddedCassandra(CassandraEmbeddedIntegrationTest.java:86)
	at com.platincoin.gidra.oauth.server.CassandraEmbeddedIntegrationTest.<init>(CassandraEmbeddedIntegrationTest.java:46)
	at com.platincoin.gidra.oauth.server.OAtuh2TokenReceivingTest.<init>(OAtuh2TokenReceivingTest.java:20)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:226)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

The application starts without any errors. Library metrics-core is exist in classpath (v.4.0.3).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
doanduyhaicommented, Jan 24, 2019

Achilles 6.0.1 released, will be available in a few hours on Maven Central

1reaction
timtebeekcommented, Jan 23, 2019

That’s a shame, but thanks for helping walk through the issue…

For now our workaround is downgrading dropwizard metrics through:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.2.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>achilles-issue-353</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <properties>
        <dropwizard-metrics.version>3.2.6</dropwizard-metrics.version>
    </properties>

Note that this, for now, seems to only way of using Spring Boot 2.1 that I could find, so it might be of use for others that stumble upon this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Error Caused by: java.lang.ClassNotFoundException ...
I tried searching github and google, didn't see any resolutions. Caused by: java.lang.ClassNotFoundException: com.codahale.metrics.JmxReporter ...
Read more >
Error > Missing com/codahale/metrics/JmxReporter class
NoClassDefFoundError: com/codahale /metrics/JmxReporter. And I can see, JmxReporter class is actually missing inside metrics-core-4.0.3.jar
Read more >
Spring-Data-Cassandra 1.5.0.M1 Beaninstantiationexception
I use achillesjunit as embedded Cassandra in spring boot test cases. NoClassDefFoundError: com/codahale/metrics/JmxReporter at com.datastax.driver.core.
Read more >
Cassandra:JmxReporter类找不到问题 - CSDN博客
问题描述:Exception in thread "main" java.lang.NoClassDefFoundError: com/codahale/metrics/JmxReporter at com.datastax.driver.core.Metrics.
Read more >
Achilles - bytemeta
Achilles repo issues. ... Achilles Junit: NoClassDefFoundError: com/codahale/metrics/JmxReporter. RaAleks. RaAleks CLOSED · Updated 3 years ago ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found