Receiving InvalidQueryException: unconfigured columnfamily on Spring Data (1.4.3.RELEASE) and Datastax Driver (2.1.9)

1,067 views
Skip to first unread message

Harvinder Singh

unread,
Jan 5, 2017, 12:42:16 AM1/5/17
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi,

I have a webapp which uses Spring Data Cassandra framework with DataStax Driver. After configuring properly with connection points, I am able to fetch all rows with (.findAll) however not with specific queries I have created for ex:

@Repository
public interface PersonRepository extends CassandraRepository<Person>{
            @Query("select * from person where firstName = ?0")
            List<Person> findByUserName(String firstName);
}

We have the following versions:
Apache Cassandra: 2.1.15
Spring Data Cassandra: 1.4.3.RELEASE
DataStax Driver : 2.1.9

ERROR:
com.datastax.driver.core.exceptions.InvalidQueryException : unconfigured columnfamily person
       com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
       com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
       com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:214)
       com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)

Do you know if there is a version conflict? Looking forward to your help/suggestions.

Thanks,
Harvi

Andrew Tolbert

unread,
Jan 5, 2017, 10:42:19 AM1/5/17
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Harvi,

This error:


ERROR:
com.datastax.driver.core.exceptions.InvalidQueryException : unconfigured columnfamily person
       com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
       com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
       com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:214)
       com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)

Indicates the table doesn't exist.  I'm not entirely familiar with spring-data, but is it possible the keyspace being used is different than what you expect?  Depending on how you configure your cassandra configuration in spring data, it should bring in the keyspace that way (there are a number of approaches described in the spring data documentation).  How are you configuring your cassandra settings in spring data?



We have the following versions:
Apache Cassandra: 2.1.15
Spring Data Cassandra: 1.4.3.RELEASE
DataStax Driver : 2.1.9

Looking at the dependency tree for spring-cassandra-data, it depends on driver version 2.1.7.1.  2.1.9 should be compatible with this, so it shouldn't be a problem.   Although as a general rule it is usually best to use the same versions called out for in the projects dependencies, unless you have a good reason (updating for known bugs, or you have other dependencies that depend on different versions).  In any case the versions are likely compatible.

Thanks,
Andy
Reply all
Reply to author
Forward
0 new messages