Spring Boot 3.3.1集成apollo-client 2.1.0版本不兼容

340 阅读1分钟

Spring Boot 3.3.1集成apollo-client 2.1.0版本不兼容

原因:snakeyaml 大版本升级后删除了SafeConstructor的默认构造函数

解决方法:升级apollo-client至2.2.0

提交日志:

-    return new Yaml(new SafeConstructor(), new Representer(), new DumperOptions(), loadingConfig);
+   DumperOptions dumperOptions = new DumperOptions();
+   return new Yaml(new SafeConstructor(loadingConfig),
            new Representer(dumperOptions), dumperOptions, loadingConfig);

Issues:

1、snakeyaml历史版本漏洞,升级2.x后存在兼容性问题 · Issue #4960 · apolloconfig/apollo

2、fix: compatible with snakeyaml-2.x by richieyan · Pull Request #35 · apolloconfig/apollo-java · GitHub