Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.env.OriginTrackedYamlLoader.createYaml(OriginTrackedYamlLoader.java:69)
The following method did not exist:
org.yaml.snakeyaml.LoaderOptions.setMaxAliasesForCollections(I)V
The method's class, org.yaml.snakeyaml.LoaderOptions, is available from the following locations:
jar:file:/E:/apache-maven-3.6.3/kucun/org/yaml/snakeyaml/1.23/snakeyaml-1.23-android.jar!/org/yaml/snakeyaml/LoaderOptions.class
jar:file:/E:/apache-maven-3.6.3/kucun/org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar!/org/yaml/snakeyaml/LoaderOptions.class
The class hierarchy was loaded from the following locations:
org.yaml.snakeyaml.LoaderOptions: file:/E:/apache-maven-3.6.3/kucun/org/yaml/snakeyaml/1.23/snakeyaml-1.23-android.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.yaml.snakeyaml.LoaderOptions
解决办法在pom.xml开头位置添加如下依赖即可
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
文章讲述了在SpringBoot应用中尝试调用不存在的方法,源于`org.yaml.snakeyaml.LoaderOptions`的冲突。解决方法是在pom.xml中添加单一致兼容的snakeyaml依赖。
4939

被折叠的 条评论
为什么被折叠?



