alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
30.35k stars 12.86k forks source link

org.yaml.snakeyaml.constructor.SafeConstructor: method 'void <init>()' not found #12848

Closed xiaohaiGit closed 1 week ago

xiaohaiGit commented 1 week ago

Describe the bug 使用最新的nacos-config-spring-boot-starter:0.3.0-RC , 报错 <org.yaml.snakeyaml.constructor.SafeConstructor: method 'void ()' not found ,发现原因是与依赖的底层的snakeyaml 接口SafeConstructor 不兼容,在snakeyaml 2.0 版本后,SafeConstructor 没有无参构造了。但是在nacos 中,依然使用SafeConstructor的无参构造。导致报错

Expected behavior org.yaml.snakeyaml.constructor.SafeConstructor: method 'void ()' not found

Actually behavior org.yaml.snakeyaml.constructor.SafeConstructor: method 'void ()' not found

How to Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See errors

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

xiaohaiGit commented 1 week ago

16e5ff6e4b799dc6800cb153d25ce0bdce669aab1062a5d13d3963b35dac1982QzpcVXNlcnNcRGVsbFxBcHBEYXRhXFJvYW1pbmdcRGluZ1RhbGtcMzIxOTAwODE1X3YyXEltYWdlRmlsZXNcMTczMTU0OTYzMDE0MF9ENTI0NzQyNC1DNkRBLTRjMjctQkMzNi05Nzg3QTUzMDk4RUMucG5n

xiaohaiGit commented 1 week ago

这个问题是出在使用springboot 3.2.0 + 的版本出现了。试了下3.1 版本的,没有这个问题。这说明, 现在的nacos springboot 版本,没有兼容最新的springboot

KomachiSion commented 1 week ago

duplicate with #12076。

welcome submit pr to fix it.