Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring3中使用Apollo 2.1.0 出现无法自动解析yaml的问题 #5281

Open
3 tasks done
painAdmin opened this issue Nov 21, 2024 · 1 comment
Open
3 tasks done

Comments

@painAdmin
Copy link

painAdmin commented Nov 21, 2024

描述bug

在springboot 3 中,使用apollo2.1.0 客户端,读取yml格式的namespace文件时,不能使用Config.getProperty(String key, String defaultValue) 获取属性值,因为apolo-client 中引用yaml版本太低,报下面的错误:
|-WARN [restartedMain] tryTransformToProperties(YamlConfigFile.java:69) - yaml to properties failed, reason: Parse yaml file content failed for namespace: ***.yml [Cause: org.yaml.snakeyaml.constructor.SafeConstructor: method 'void ()' not found]

复现

通过如下步骤可以复现:

  1. 创建yml格式的namespace文件,添加相关属性
  2. 创建springboot项目,版本号:3.3.3,spring版本6.1.12,snakeyaml:2.2
  3. 服务启动后,在项目中使用Config.getProperty(String key, String defaultValue) 获取属性值,
  4. 结果无法读取到

期望

希望后续的版本中修复这个问题

截图
image

如果可以,附上截图来描述你的问题

额外的细节和日志

  • 版本:
  • 错误日志
  • 配置:
  • 平台和操作系统
@nobodyiam
Copy link
Member

It is fixed in apollo-java 2.2.0, see apolloconfig/apollo-java#35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants