title: com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces
body: <p>I am trying to configure spring data with cassandra.
  But I am getting bellow error , when my app is deploying in tomcat.</p>
  
  <p>When I check the connection, it is available to the given port. (127.0.0.1:9042). I have include stack trace and spring configuration bellow.
  Does anyone having idea on this error? </p>
  
  <p>Full stack trace :</p>
  
  <pre><code>2015-12-06 17:46:25 ERROR web.context.ContextLoader:331 - Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSession': Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces))
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1572)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)
      at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces))
      at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223)
      at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78)
      at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1230)
      at com.datastax.driver.core.Cluster.init(Cluster.java:157)
      at com.datastax.driver.core.Cluster.connect(Cluster.java:245)
      at com.datastax.driver.core.Cluster.connect(Cluster.java:278)
      at org.springframework.cassandra.config.CassandraCqlSessionFactoryBean.afterPropertiesSet(CassandraCqlSessionFactoryBean.java:82)
      at org.springframework.data.cassandra.config.CassandraSessionFactoryBean.afterPropertiesSet(CassandraSessionFactoryBean.java:43)
  </code></pre>
  
  <p>===================================================================</p>
  
  <p>Spring Configuration :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans:beans ...&gt;
  
      &lt;cassandra:cluster id="cassandraCluster"
                         contact-points="127.0.0.1" port="9042" /&gt;
      &lt;cassandra:converter /&gt;
  
      &lt;cassandra:session id="cassandraSession" cluster-ref="cassandraCluster"
                         keyspace-name="blood" /&gt;
  
      &lt;cassandra:template id="cqlTemplate" /&gt;
  
  
      &lt;cassandra:repositories base-package="com.blood.dao.nosql" /&gt;
      &lt;cassandra:mapping entity-base-packages="com.blood.domain.nosql" /&gt;
  
  &lt;/beans:beans&gt;
  </code></pre>