3
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JournalActions': Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.InvalidQueryException: Keyspace 'audit' does not exist
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
    at com.paypal.pps.activity.init.RaptorApplication.main(RaptorApplication.java:23)
Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Keyspace 'audit' does not exist

But when i manually login to cqlsh , i'm able to select the table.

cqlsh:journal> use audit;

cqlsh:audit> select * from event_log;

event_id | event_type


i'm using Cassandra 3.9 running on a docker

Community
  • 1
  • 1
jAvA
  • 557
  • 1
  • 8
  • 22

1 Answers1

2

You have already narrowed down the problem(in cqlsh the queries are working), so the problem is on the driver side.

Please ensure the following

1) Driver used (datastax.cassandra - cassandra-driver-core - version 3.0.0-alpha5) is compatible with Cassandra DB Version

2) Remove if you have any spring-data-cassandra libraries reference in your project

Please Refer these posts for more info

https://docs.datastax.com/en/developer/driver-matrix/doc/javaDrivers.html#java-drivers

com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces

Community
  • 1
  • 1
Clement Amarnath
  • 5,301
  • 1
  • 21
  • 34
  • sudo docker run --name dc101 -P -d -e CASSANDRA_CLUSTER_NAME="Cluster1" -e CASSANDRA_DC="datacenter1" -e CASSANDRA_RACK="rc1" -e CASSANDRA_ENDPOINT_SNITCH="GossipingPropertyFileSnitch" -e CASSANDRA_RPC_ADDRESS="" -e CASSANDRA_BROADCAST_ADDRESS="" -p 9042:9042 cassandra:latest . this is how i created cassandra node, this is not listening to the 9042 port – jAvA Dec 21 '16 at 03:31
  • @jAvA -This looks like another issue, please post it as another question – Clement Amarnath Dec 21 '16 at 06:57