Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep classes from Cassandra Java Driver #149

Closed
wants to merge 1 commit into from

Conversation

vlsi
Copy link
Contributor

@vlsi vlsi commented Feb 11, 2025

Which problem is this PR solving?

Caused by: java.lang.IllegalArgumentException: Can't find class DefaultMetricsFactory (specified by advanced.metrics.factory.class)
	at com.datastax.oss.driver.internal.core.util.Reflection.resolveClass(Reflection.java:302)
	at com.datastax.oss.driver.internal.core.util.Reflection.buildFromConfig(Reflection.java:235)
	at com.datastax.oss.driver.internal.core.util.Reflection.buildFromConfig(Reflection.java:110)
	at com.datastax.oss.driver.internal.core.context.DefaultDriverContext.buildMetricsFactory(DefaultDriverContext.java:548)

Description of the changes

Include all the classes from Cassandra Java Driver as it includes shaded dependencies.

How was this change tested?

Note that both jaeger-spark-dependencies-cassandra and jaeger-spark-dependencies-elasticsearch test unshaded artifacts, so they do not detect issues caused by shading.

Previously, local execution of STORAGE=cassandra CASSANDRA_USERNAME=cassandra CASSANDRA_PASSWORD=cassandra java -jar jaeger-spark-dependencies-0.0.1-SNAPSHOT.jar reproduced Can't find class DefaultMetricsFactory

After the fix, the error is gone.

Checklist

This resolves

Caused by: java.lang.IllegalArgumentException: Can't find class DefaultMetricsFactory (specified by advanced.metrics.factory.class)
	at com.datastax.oss.driver.internal.core.util.Reflection.resolveClass(Reflection.java:302)
	at com.datastax.oss.driver.internal.core.util.Reflection.buildFromConfig(Reflection.java:235)
	at com.datastax.oss.driver.internal.core.util.Reflection.buildFromConfig(Reflection.java:110)
	at com.datastax.oss.driver.internal.core.context.DefaultDriverContext.buildMetricsFactory(DefaultDriverContext.java:548)

Signed-off-by: Vladimir Sitnikov <[email protected]>
@vlsi
Copy link
Contributor Author

vlsi commented Feb 11, 2025

@yurishkuro , do you think this is mergeable?
Would you suggest going with minimizeJar=false instead? I'm leaning towards minimizeJar=false.

Frankly, I'm not very fluent with Maven to make it execute tests over the shaded artifacts.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to make tests depend on the minified jar?

@vlsi
Copy link
Contributor Author

vlsi commented Feb 11, 2025

Is there a way to make tests depend on the minified jar?

I could make it if the build was Gradle-based.

For Maven, the answer seems to use "maven invoker" plugin (I've never used it though): https://stackoverflow.com/a/74302074

@yurishkuro
Copy link
Member

ok, then can you test manually and post evidence?

@vlsi
Copy link
Contributor Author

vlsi commented Feb 12, 2025

Closing in favour of #150

@vlsi vlsi closed this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants