While declaring a property having value like (secret: @t3mokz%OQwkM%fOg#P2) in .yml file throws an error at configuration server.
org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
in 'reader', line 815, column 14:
password: @t3mokz%OQwkM%fOg#P2
^
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:420) ~[snakeyaml-1.16.jar:na]
at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226) ~[snakeyaml-1.16.jar:na]
at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586) ~[snakeyaml-1.16.jar:na]
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[snakeyaml-1.16.jar:na]
at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143) ~[snakeyaml-1.16.jar:na]
at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:132) ~[snakeyaml-1.16.jar:na]
This is really a yaml usage question. Try with single quotes around the value like secret: '@t3mokz%OQwkM%fOg#P2'
when I use actuactor in spring cloud, need to set some configuration like this:
info:
app:
name: '@project.artifactId@'
java:
source: '@java.version@'
but in this way,when i enter "localhost:8200/info",it show it's literal meaning liken this:
{
"app": {
"name": "@project.artifactId@",
"java": {
"source": "@java.version@"
}
}
}
in actuator documentation,it should shows like this:
{
"app": {
"name": "microservice",
"java": {
"source": "1.8.0_92"
}
}
}
how did I resolve this problem?
This is not related to Spring Cloud Config. If you have an actuator question than best to ask a question on StackOverflow or the Spring Boot Gitter channel.
it is related to your scan config:
1.check your pom.xml file and make sure the tag <build> is exsit.
2.then point the resource directory to your yml/xml file
Most helpful comment
when I use actuactor in spring cloud, need to set some configuration like this:
but in this way,when i enter "localhost:8200/info",it show it's literal meaning liken this:
in actuator documentation,it should shows like this:
how did I resolve this problem?