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

Catch and ignore more errors when reflecting into container subclass #5990

Merged
merged 1 commit into from Oct 14, 2022

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 as a code owner 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.

None yet

3 participants