Total Pageviews

2019/10/13

[Spring Boot] found character '%' that cannot start any token. (Do not use % for indentation)

Problem
My application.yaml looks like:
excel:
  revenue:
    path: F:\\報表\\
    fileName: %s年%s月報表.xls



When I startup my spring boot project, it showed the following error message and fail to startup:
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)
 in 'reader', line 8, column 15:
        fileName: %s年%s月報表.xls
                  ^


How-To
Add single quote to head and tail.
excel:
  revenue:
    path: F:\\報表\\
    fileName: `%s年%s月報表.xls`    



No comments: