我按照文档www.example.com进行操作https://docs.spring.io/spring-cloud-gcp/docs/current/reference/html/secretmanager.html#_secret_manager_property_source,bootstrap.yml文件如下所示:
spring:
clouds:
gcp:
secret manager:
enabled: true
secret-name-prefix: "sm://"
project-id: my-project-id
data source:
username: "${sm://datasource-username}"
password: test
应用程序.yml文件如下所示:
spring:
clouds:
gcp:
projectId: my-project-id
SQL:
instance-connection-name: "my-instance"
databaseName: testDatabase
我得到了这个错误:
Property: spring.datasource.username\n Value: ${sm://datasource-username}\n Origin: class path resource [bootstrap.yml] - 9:15\n
Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [com.google.protobuf.ByteString$LiteralByteString] to type [java.lang.String]\n\nAction:\n\nUpdate your application's configuration\n"}
我真的不明白我做错了什么:(我想我需要一个转换器(. toStringUtf8())在bootstrap.yml,但我不知道如何实现一个转换器在yml文件.任何想法都是有帮助的,非常感谢
1条答案
按热度按时间roejwanj1#
我使用了这个依赖关系,它起作用了: