org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found character ‘@‘ t
程序员文章站
2022-04-15 17:35:25
...
问题
SpringBoot项目,用的是yaml格式的配置,之前一切OK,今天启动突然报了个错;
Caused by: org.yaml.snakeyaml.scanner.ScannerException:
while scanning for the next token found character '@' that cannot start any token.
(Do not use @ for indentation)
分析
Do not use @ for indentation
在配置文件里的确定义了一个这样的变量:
level.cn.gwssi: @logging.[email protected]
使用 @ 这样的格式是为了让yml读取 maven pom文件中 profile变量,pom.xml中的变量如下:
<properties>
<spring.active>local</spring.active>
<logging.level>DEBUG</logging.level>
</properties>
解决
尝试 maven reimport ,问题解决。
参考:
【1】:Spring Boot property expansion not working after switching from Eclipse to IntelliJ
上一篇: oracle12c,各种问题解决方案
下一篇: 解决org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found character '%'
推荐阅读
-
org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found character ‘@‘ t
-
解决org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found character '%'
-
org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
-
org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found character ‘@‘ t