User3518958
User3518958

Reputation: 716

Failed to bind properties under 'cluster' to com.datastax.driver.core.Cluster

I am getting following exception while running a spring boot application :

Failed to bind properties under 'cluster' to com.datastax.driver.core.Cluster:

    Property: cluster
    Value: 
    Origin: "cluster" from property source "class path resource [application.yml]"
    Reason: No converter found capable of converting from type [java.lang.String] to type [com.datastax.driver.core.Cluster]

Action:

Update your application's configuration

The configuration file is being read from consul. So, as seen from the error description, the value of the property 'cluster' is found empty. But config as seen the file, looks like :

cassandra:
  host: abc:50126
  forceSchemaCreation: false
  cluster:
    name: test_cluster    
    user: test_user
    password: password    
    defaultFetchSize: 10000
    callback.executor.pool: 10

Also, because I was getting 'Command line too long' message while running the application, I set 'dynamic.classpath' to true in workspce file.

Upvotes: 1

Views: 401

Answers (1)

Sumit A
Sumit A

Reputation: 180

Can there be a syntactical error in the yml file?
I don't see any error in the yml file.

Why does error say 'cluster' instead of 'cassandra.cluster'?
The 'Origin' part in the description points to 'class path resource [application.yml]'. This should be a concern?
Please check if you are using @ConfigurationProperties over your Configuration class. If yes, please try removing it, if not needed. Just @Configuration would be good to autowire all your global properties in the yml.

Upvotes: 1

Related Questions