java - Spring Boot with Cassandra 3.x driver -
i use spring boot 1.3.8.release
. use cassandra 3.x driver tried below;
<dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-data-cassandra</artifactid> <exclusions> <exclusion> <groupid>org.springframework.data</groupid> <artifactid>spring-data-cassandra</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.springframework.data</groupid> <artifactid>spring-data-cassandra</artifactid> <version>1.4.0.release</version> <exclusions> <exclusion> <groupid>com.datastax.cassandra</groupid> <artifactid>cassandra-driver-core</artifactid> </exclusion> <exclusion> <groupid>com.datastax.cassandra</groupid> <artifactid>cassandra-driver-dse</artifactid> </exclusion> </exclusions> </dependency> <!-- https://mvnrepository.com/artifact/com.datastax.cassandra/cassandra-driver-core --> <dependency> <groupid>com.datastax.cassandra</groupid> <artifactid>cassandra-driver-core</artifactid> <version>3.1.0</version> </dependency>
but error;
caused by: java.lang.nosuchmethoderror: com.datastax.driver.core.datatype.asjavaclass()ljava/lang/class; @ org.springframework.data.cassandra.mapping.cassandrasimpletypeholder.<clinit>(cassandrasimpletypeholder.java:62) ~[spring-data-cassandra-1.4.0.release.jar:?]
i tried cause @ https://github.com/spring-projects/spring-boot/issues/5835 , there post ;
adopting cassandra 3 changes in spring data cassandra 1.5 (ingalls) not impose breaking changes spring boot. tested upgrade boot 1.3.3 , 1.4.0-snapshot.
isn't supposed above? wrong?
note: trying example: https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-cassandra
spring-data-cassandra-1.4.0.release depends on <cassandra.version>2.1.11</cassandra.version>
, <cassandra-driver-dse.version>2.1.7.1</cassandra-driver-dse.version>
see https://github.com/spring-projects/spring-data-cassandra/blob/1.4.0.release/pom.xml.
if want use cassandra 3.x should upgrade spring-boot 1.5.x benifit spring-boot-starter-data-cassandra:1.5.x depends on <cassandra.version>3.0.0</cassandra.version>
, <cassandra-driver.version>3.0.3</cassandra-driver.version>
see https://github.com/spring-projects/spring-data-cassandra/blob/1.5.0.m1/pom.xml
remove cassandra driver dependency pom file. spring boot provide right version
Comments
Post a Comment