spring-boot - 执行器暴露端点在 spring boot2.5.2 中不起作用
问题描述
当我使用执行器暴露端点时,我使用 springboot 2.5.2 版本,它显示了一些错误:
09:48:48.938 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.yaml.snakeyaml.scanner.ScannerException: while scanning an alias
in 'reader', line 18, column 18:
include: *
^
unexpected character found (0)
in 'reader', line 18, column 19:
include: *
^
引导程序.yml:
management:
endpoints:
web:
exposure:
include: *
我在我的 gradle.kt 中使用执行器 gradle 依赖,但为什么我在 yml 文件中声明管理端点时遇到问题?
解决方案
*
是 YAML 中的特殊字符。它为一个值添加前缀以表明它是一个别名。要将其用作字符串,正如您在此处所做的那样,请将其用引号括起来:
management:
endpoints:
web:
exposure:
include: '*'
推荐阅读
- node.js - Firestore 文档查询
- python - Pandas 如何打印某一列
- json - 根据值过滤 JSON
- javascript - 使用 React-Icon 库将鼠标悬停在图标上时显示文本
- tensorflow - 使用tensorflow和keras在python中用CNN替换MLP代码
- amazon-web-services - postmap: warning: database /etc/postfix/sasl_passwd.db is older than source file /etc/postfix/sasl_passwd
- ios - 如何更新 UWP appxupload 包而不重建以针对多个环境
- java - Returning Map from JDBC template execution
- java - Spring Boot Data JPA中的自联接-仅显示第一个子节点(第0个元素)而不是所有子节点
- amazon-web-services - How to disable certain AWS Cognito APIs?