【发布时间】:2018-12-18 16:44:20
【问题描述】:
运行 Spring Boot 应用程序时出现以下异常:
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
正在从 consul 读取配置文件。因此,从错误描述中可以看出,属性“cluster”的值是空的。但配置如文件所见,看起来像:
cassandra:
host: abc:50126
forceSchemaCreation: false
cluster:
name: test_cluster
user: test_user
password: password
defaultFetchSize: 10000
callback.executor.pool: 10
- yml 文件中可能存在语法错误吗? 或者
- 为什么错误提示“cluster”而不是“cassandra.cluster”?怀疑这部分是对的吗? 或者
- 描述中的“Origin”部分指向“类路径资源 [application.yml]”。这应该是一个问题?
另外,因为我在运行应用程序时收到“Command line too long”消息,所以我在工作空间文件中将“dynamic.classpath”设置为 true。
【问题讨论】:
标签: java maven spring-boot cassandra