Open SuperZ1999 opened 11 months ago
补充一点信息: JDK:21 SpringBoot:3.2.3 nacos版本:0.3.0-RC snakeyaml·版本:2.2
报错堆栈:
Caused by: java.lang.NoSuchMethodError: org.yaml.snakeyaml.constructor.SafeConstructor: method 'void <init>()' not found
at com.alibaba.nacos.spring.util.parse.DefaultYamlConfigParse.createYaml(DefaultYamlConfigParse.java:66)
at com.alibaba.nacos.spring.util.parse.DefaultJsonConfigParse.parse(DefaultJsonConfigParse.java:42)
at com.alibaba.nacos.spring.util.ConfigParseUtils.toProperties(ConfigParseUtils.java:95)
at com.alibaba.nacos.spring.util.ConfigParseUtils.toProperties(ConfigParseUtils.java:119)
at com.alibaba.nacos.spring.util.NacosUtils.toProperties(NacosUtils.java:542)
at com.alibaba.nacos.spring.core.env.NacosPropertySource.<init>(NacosPropertySource.java:62)
at com.alibaba.boot.nacos.config.binder.NacosBootConfigurationPropertiesBinder.doBind(NacosBootConfigurationPropertiesBinder.java:58)
at com.alibaba.nacos.spring.context.properties.config.NacosConfigurationPropertiesBinder.bind(NacosConfigurationPropertiesBinder.java:123)
at com.alibaba.nacos.spring.context.properties.config.NacosConfigurationPropertiesBindingPostProcessor.bind(NacosConfigurationPropertiesBindingPostProcessor.java:91)
at com.alibaba.nacos.spring.context.properties.config.NacosConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(NacosConfigurationPropertiesBindingPostProcessor.java:68)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
... 25 more
添加 -DyamlAllowComplexObject=true
切换到 Constructor 也报错
Issue Description
Type: feature request
Describe what happened (or what feature you want)
nacos-spring-project 适配 snakeyaml2.0
Tell us your environment
JDK8