I am trying to build a very simple api connecting to an astra Cassandra nodal database with spring boot. However, even when I have specified the keyspace in application.yml, it still throws the exception:
com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: No keyspace has been specified. USE a keyspace, or explicitly specify keyspace.tablename
Here is my application.yml:
astra.api:
application-token: <my-token>
database-id: <my-db-id>
database-region: <my-db-region>
astra.cql:
enabled: true
downloadScb.path: secure-connect.zip
spring.data.cassandra:
keyspace-name: shopping_list
schema-action: CREATE_IF_NOT_EXISTS
I have also tried using keyspace
instead of keyspace-name
, and putting it under astra.api or even astra.cql. None of these works, though.
I am following this tutorial exactly but I cannot figure out what is the problem.
I have checked the token, database-id and database-region are all correct and the secure connect bundle is also there. The application can indeed get the other values from application.yml such as the scb path and schema-action but apparently not keyspace-name.
Thanks a lot for any input!