akshita
akshita

Reputation: 1

How do I upgrade Cassandra Java driver 3.11.3 to 4.0.0 for Spring?

I am supposed to upgrade my Cassandra version to 4.0.0 but whenever I am doing so I am getting the many issues like these:

error: error: cannot access TypeCodec,
error: cannot find symbol

And it is not able to find my autowired and injected mocks in the repo. On upgrading the version I am left with so many similar issues that it seems impossible to upgrade the same. I tried to solve the issue by downgrading achilles-core but that is also not working for me.

Sharing the smaller version of POM, can somebody please help me to upgrage the version without getting many issues? Also my project is using spring version 4.0.

<dependency>
        <groupId>info.archinnov</groupId>
        <artifactId>achilles-core</artifactId>
        <version>${achilles.version}</version>
        <exclusions>
            <exclusion>
                <artifactId>cassandra-driver-core</artifactId>
                <groupId>com.datastax.cassandra</groupId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>com.datastax.cassandra</groupId>
        <artifactId>cassandra-driver-core</artifactId>
        <version>4.0.0</version>
    </dependency>

Upvotes: 0

Views: 61

Answers (1)

Erick Ramirez
Erick Ramirez

Reputation: 16373

The Cassandra Java driver has been completely redesigned in 4.0.0 and it is not binary-compatible with the older versions of the driver so you will need to refactor your application.

For example, the Cluster and Session objects do not exist anymore and have been replaced with CqlSession. Similarly, most of the configuration items are now file-based.

To echo @Andrew's comment above, we do not recommend upgrading to 4.0.0 because it is too old (released in 2019). We recommend upgrading to the latest release (v4.18.1 at the time of writing) to get the most up-to-date patched version.

For detailed upgrade instructions, see the Cassandra Java driver Upgrade Guide and Spring Data Cassandra Migration Guides. Cheers!

Upvotes: 0

Related Questions