gradle - astyanax cassandra: The type org.apache.cassandra.thrift.Cassandra$Client cannot be resolved. It is indirectly referenced from required .class files -
my internship needs me familiar cassandra. downloaded astyanax cassandra from: https://github.com/netflix/astyanax
after building astyanax source via commands: git clone git@github.com:netflix/astyanax.git cd astyanax ./gradlew build
i created new java project , copy+paste sample code here: https://github.com/netflix/astyanax/blob/master/astyanax-examples/src/main/java/com/netflix/astyanax/examples/astcqlclient.java
now problems arose. did fix path configuration, importing .jar files generated gradlew build. 1 (long)line of code highlighted red dash:
context = new astyanaxcontext.builder() .forcluster("test cluster") .forkeyspace("test1") .withastyanaxconfiguration(new astyanaxconfigurationimpl() .setdiscoverytype(nodediscoverytype.ring_describe) ) .withconnectionpoolconfiguration(new connectionpoolconfigurationimpl("myconnectionpool") .setport(9160) .setmaxconnsperhost(1) .setseeds("127.0.0.1:9160") ) .withastyanaxconfiguration(new astyanaxconfigurationimpl() .setcqlversion("3.0.0") .settargetcassandraversion("1.2")) .withconnectionpoolmonitor(new countingconnectionpoolmonitor()) .buildkeyspace(thriftfamilyfactory.getinstance());
the warning message is: type org.apache.cassandra.thrift.cassandra$client cannot resolved. indirectly referenced required .class files
i need experts help. lot!!!
sounds missing thrift dependency (thrift jar file). either or using incompatible version of thrift. simple solution use maven , add astyanax dependency project. more complex solution verify that version of thrift import compatible version of astyanax being used.
maven dependency (add pom file):
<dependency> <groupid>com.netflix.astyanax</groupid> <artifactid>astyanax</artifactid> <version>1.56.42</version> </dependency>
you can work out compatible version of thrift astyanax client using astyanax's wiki. knowing built project github, want latest thrift compatible cassandra, after thrift 9.0+ (for example libthrift-0.9.0.jar
).
Comments
Post a Comment