I'm running into an issue trying to connect my java application to an instance of Cassandra running in graph mode. When I try to create my connection, I'm getting the following exception
java.lang.IllegalAccessError: tried to access class com.datastax.driver.core.TypeCodec from class com.datastax.driver.dse.graph.PayloadHelper
at com.datastax.driver.dse.graph.PayloadHelper.asBytes(PayloadHelper.java:19) ~[dse-driver-1.1.2.jar:na]
at com.datastax.driver.dse.graph.GraphOptions.rebuildDefaultPayload(GraphOptions.java:286) ~[dse-driver-1.1.2.jar:na]
at com.datastax.driver.dse.graph.GraphOptions.<init>(GraphOptions.java:59) ~[dse-driver-1.1.2.jar:na]
at com.datastax.driver.dse.DseCluster$Builder.getConfiguration(DseCluster.java:269) ~[dse-driver-1.1.2.jar:na]
at com.datastax.driver.dse.DseCluster$Builder.getConfiguration(DseCluster.java:69) ~[dse-driver-1.1.2.jar:na]
at com.datastax.driver.core.Cluster.<init>(Cluster.java:115) ~[cassandra-driver-core-2.1.9.jar:na]
at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:182) ~[cassandra-driver-core-2.1.9.jar:na]
at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1285) ~[cassandra-driver-core-2.1.9.jar:na]
at com.datastax.driver.dse.DseCluster$Builder.build(DseCluster.java:261) ~[dse-driver-1.1.2.jar:na]
The application doesn't do much of anything right now except initialize a bean that tries to connect to my running cassandra. I can connect to my cassandra node just fine using datastax studio and execute gremlin queries. All of the examples I've seen here and elsewhere use the same boilerplate code to connect so I'm not sure what is going on. Any threads I could follow would be much appreciated
pom
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Datastax Enterprise Graph -->
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>dse-driver</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
Initialization code
import com.datastax.driver.dse.DseCluster;
import com.datastax.driver.dse.DseSession;
import org.springframework.stereotype.Repository;
@Repository("crmGraph")
public class CrmGraph implements Storage{
private DseSession dseSession = null;
public CrmGraph() {
DseCluster dseCluster = DseCluster.builder().addContactPoint("127.0.0.1").build();
dseSession = dseCluster.connect();
}
...
}