Skip to content

Can't use v4.14.0 with liquibase if CassandraConnection created from CqlSession #78

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

Closed
BenderBay opened this issue Mar 12, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@BenderBay
Copy link

Earlier versions are fine.

################

How to reproduce:
1. Create cqlSession and use it for creation of CassandraConnection. For example:

final CqlSession session = CqlSession.builder()
.addContactPoint(new InetSocketAddress("localhost", 9042))
.withLocalDatacenter("DC1")
.build();
final Connection dbConn = new CassandraConnection(
session, "keyspace", ConsistencyLevel.ALL, false, new Default()
);

2. Create CassandraDatabase and set Connection

CassandraDatabase database = new CassandraDatabase();
database.setConnection(new JdbcConnection(dbConn));

########### Stacktrace:

Caused by:
java.lang.NullPointerException: Cannot invoke "String.matches(String)" because "this.url" is null
at com.ing.data.cassandra.jdbc.CassandraConnection.isNotConnectedToAmazonKeyspaces(CassandraConnection.java:277)
at com.ing.data.cassandra.jdbc.metadata.BasicVersionedMetadata.fulfillAdditionalCondition(BasicVersionedMetadata.java:131)
at com.ing.data.cassandra.jdbc.utils.DriverUtil.lambda$buildMetadataList$0(DriverUtil.java:176)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.ing.data.cassandra.jdbc.utils.DriverUtil.buildMetadataList(DriverUtil.java:179)
at com.ing.data.cassandra.jdbc.CassandraDatabaseMetaData.getSQLKeywords(CassandraDatabaseMetaData.java:714)
at liquibase.database.jvm.JdbcConnection.attached(JdbcConnection.java:57)
at liquibase.database.AbstractJdbcDatabase.setConnection(AbstractJdbcDatabase.java:162)

@maximevw maximevw added bug Something isn't working to investigate Investigation needed labels Mar 12, 2025
@maximevw maximevw changed the title Cann't use v4.14.0 with liquibase if CassandraConnection created from CqlSession Can't use v4.14.0 with liquibase if CassandraConnection created from CqlSession Mar 12, 2025
@maximevw maximevw removed the to investigate Investigation needed label Mar 22, 2025
@maximevw
Copy link
Collaborator

Hello @BenderBay

Sorry for the delay. This has been fixed by the commit 577b264 and it will be released soon in the version 4.15.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants