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

适配 snakeyaml2.0 #319

Open
SuperZ1999 opened this issue Sep 28, 2023 · 4 comments
Open

适配 snakeyaml2.0 #319

SuperZ1999 opened this issue Sep 28, 2023 · 4 comments

Comments

@SuperZ1999
Copy link
Contributor

Issue Description

Type: feature request

Describe what happened (or what feature you want)

nacos-spring-project 适配 snakeyaml2.0

Tell us your environment

JDK8

@pdkst
Copy link
Contributor

pdkst commented Apr 2, 2024

补充一点信息:
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

@dujie-js
Copy link

image

@immadolf
Copy link

添加 -DyamlAllowComplexObject=true 切换到 Constructor 也报错
image

@Jiiiiiin
Copy link

https://mvnrepository.com/artifact/com.alibaba.nacos/nacos-spring-context/2.1.0-RC 找个版本还在在, 0.3.0-RC的间接依赖。

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

5 participants