Skip to content

Conversation

@akhaku
Copy link
Contributor

@akhaku akhaku commented Oct 14, 2022

With #2830 we added support for 4.x of the Cassandra driver. It was done in a way to allow a user to use either the 3.x or 4.x driver while excluding the other one. However if using 4.x and excluding 3.x, GenericContainer#canBeReused throws an exception during reflection since the Cluster class returned by CassandraContainer#getCluster is missing.

This PR works around that issue by catching and ignoring the thrown NoClassDefFoundError.

With testcontainers#2830 we added support for 4.x of the Cassandra driver.
It was done in a way to allow a user to use either the 3.x
or 4.x driver while excluding the other one. However if
using 4.x and excluding 3.x, GenericContainer#canBeReused
throws an exception during reflection since the Cluster
class returned by CassandraContainer#getCluster is missing.

This PR works around that issue by catching and ignoring
the thrown NoClassDefFoundError.
@akhaku akhaku requested a review from a team October 14, 2022 00:19
@eddumelendez eddumelendez added this to the next milestone Oct 14, 2022
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

thanks for your contribution @akhaku ! I was able to replicate the issue

@eddumelendez eddumelendez merged commit 96acaf0 into testcontainers:main Oct 14, 2022
@eddumelendez
Copy link
Member

thanks again @akhaku ! This is now merge in main branch.

@akhaku akhaku deleted the catchException branch October 14, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants