0

I am trying to connect to Cassandra 2.0.3 using cassandra-jdbc-1.2.5. But it is giving error:

Any solution?

Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder; at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254) at org.apache.cassandra.cql.jdbc.CassandraDriver.(CassandraDriver.java:52) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at cql.main(cql.java:13) Java Result: 1

user1540371
  • 99
  • 2
  • 9
  • You have a wrong version of SLF4J on your classpath. – Ralf Apr 24 '14 at 12:27
  • and what about this: org.apache.cassandra.cql.jdbc.CassandraDriver.(CassandraDriver.java:52) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at cql.main(cql.java:13) Java Result: 1 – user1540371 Apr 24 '14 at 12:34
  • Um, yes, What about it? That's the root of the call-stack. – Ralf Apr 24 '14 at 13:13

1 Answers1

1

cassandra-jdbc does not currently support Cassandra 2.0.x. If you want to use jdbc, you'll need to downgrade to C* 1.2.16.

If you can, I'd suggest using the CQL language and native protocol instead of jdbc as it provides a much more idiomatic cassandra interface as well as more sophisticated connection pooling, request routing, failover handling etc.

The latest java drivers can be found here: https://github.com/datastax/java-driver

beobal
  • 274
  • 1
  • 4