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.

Remove dependency on DropwizardMetricsFactory in native-image's classpath dependencies when using Cassandra

See original GitHub issue

This problem appears only when I run a Quarkus’ native runner.

Example, with a simple quarkus-app.jar I don’t get the problem, but when I build a native image runner, this problem appears during each Cassandra requesting.

In my project I use following Quarkus’ version:

<quarkus-plugin.version>1.12.1.Final</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.12.1.Final</quarkus.platform.version>

And I built the application with “mvn clean package -Pnative -Dnative-image.xmx=9g” command line.It’s very strange because, even if I set:

“quarkus.cassandra.metrics.enable=false” without dependency to “java-driver-metrics-micrometer” (or micropofile or metrics-jmx" dependency)

Or “quarkus.cassandra.metrics.enable=true” with dependency to “java-driver-metrics-micrometer” (or micropofile or metrics-jmx" dependency)

The bevaviour when the native image running, is the same … ClassNotFoundException.I don’t know with this problem appears only in native mode, but I search a mean to “disabled” the metrics’ system (for more lightness, or even at worst have them at runtime, but without the error)

I tried with the most recent com.datastax.oss java-driver-code’s version “4.10.0”

But I was hoping to have the behavior advertised in the documentation, but unless I’m wrong about being able to disable … I just wish I didn’t have the problem

But for me it seems the DropwizardMetricsFactory class isn’t registered for reflexion at the runtime. I know is possible to register it, but if I make this, should register all the linked classes located in ?

   <dependency>
            <groupId>com.datastax.oss</groupId>
            <artifactId>java-driver-core</artifactId>
            <version>4.10.0</version>
    </dependency>

I don’t know the best to by default registe the Datastax classes which cause the problem, or fixe the problem by not searching to instanciate the factory is the application.propreties of metrics.enable is to “false” value.

I precise, I tried to use all following dependencies, but same thing, not found at the native’s runtime: <dependency> <groupId>com.datastax.oss</groupId> <artifactId>java-driver-metrics-micrometer</artifactId> <version>4.10.0</version> </dependency> <dependency> <groupId>io.dropwizard.metrics</groupId> <artifactId>metrics-jmx</artifactId> <version>4.1.18</version> </dependency> <dependency> <groupId>com.datastax.oss</groupId> <artifactId>java-driver-metrics-microprofile</artifactId> <version>4.10.0</version> </dependency>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Mar 11, 2021

Closing then, thanks!

0reactions
adutracommented, Mar 30, 2021

Hi, for future reference, indeed this issue was fixed in the Cassandra driver 4.11.0, see here. Then the fix was incorporated in the Cassandra extension 1.0.1, see here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataStax Java Driver - Using the shaded JAR
Using the shaded JAR. The default driver JAR depends on Netty, which is used internally for networking. This explicit dependency can be a...
Read more >
What is jnr-posix and jnr-ffi dependencies for? - Google Groups
to DataStax Java Driver for Apache Cassandra User Mailing List ... Drop jnr dependencies from my CLASSPATH -> will have old timestamps generation...
Read more >
Is cassandra-driver-core dependency removed as part of DSE ...
With DSE Cassandra 5.x, in the client code is cassandra-driver-core to be excluded from dependency due to deprecation?
Read more >
3 Using the Cassandra Handler - GoldenGate
classpath configuration property in the Java Adapter properties file to specify the JARs for the Datastax Java Driver for Cassandra. Ensure that this...
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