微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SpringBoot启动yaml报错的解决

这篇文章主要介绍了SpringBoot启动yaml报错的解决方案,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

SpringBoot启动yaml报错

报错找不到org.yaml里的一个方法

10:45:54.742 [main] ERROR org.springframework.boot.SpringApplication - Application run Failed java.lang.NoSuchMethodError: org.yaml.snakeyaml.nodes.ScalarNode.getScalarstyle()Lorg/yaml/snakeyaml/DumperOptions$Scalarstyle; at org.springframework.boot.env.OriginTrackedYamlLoader$KeyScalarNode.(OriginTrackedYamlLoader.java:127) at org.springframework.boot.env.OriginTrackedYamlLoader$KeyScalarNode.get(OriginTrackedYamlLoader.java:138) at org.springframework.boot.env.OriginTrackedYamlLoader$KeyScalarNode.get(OriginTrackedYamlLoader.java:133) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndcopyInto(AbstractPipeline.java:472) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) at org.springframework.boot.env.OriginTrackedYamlLoader$OriginTrackingConstructor.replaceMappingNodeKeys(OriginTrackedYamlLoader.java:99) at org.springframework.boot.env.OriginTrackedYamlLoader$OriginTrackingConstructor.constructObject(OriginTrackedYamlLoader.java:92) at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:161) at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:127) at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:547) at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:160) at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:134) at org.springframework.boot.env.OriginTrackedYamlLoader.load(OriginTrackedYamlLoader.java:75) at org.springframework.boot.env.YamlPropertySourceLoader.load(YamlPropertySourceLoader.java:50) at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadDocuments(ConfigFileApplicationListener.java:574) at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:528) at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadForFileExtension(ConfigFileApplicationListener.java:502) at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:469) at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$null$6(ConfigFileApplicationListener.java:450) at java.lang.Iterable.forEach(Iterable.java:75) at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$load$7(ConfigFileApplicationListener.java:449) at java.lang.Iterable.forEach(Iterable.java:75) at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:446) at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:334) at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:209) at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:192) at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:179) at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347) at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)

解决

核对了下引入的包,发现项目中额外引入了1.19版本的org.yaml.snakeyaml包,这个包里确实没有这个方法。把这个包改成1.26的即可。

SpringBoot配置文件application.yml遇到的坑

上一篇:IDEA2021常用优化设置步骤图解下一篇解决springboot报错找不到自动注入的service问题 热门搜索

启动报错 

boot启动报错 

PHP启动报错 

springboot启动原理 

启动程序报错 

相关文章

SpringBoot启动yaml报错的解决

2021-09-10阅读(2844)评论(0)推荐()

这篇文章主要介绍了SpringBoot启动yaml报错的解决方案,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

Springboot项目因为kackson版本问题启动报错解决方

2021-11-08阅读(2594)评论(0)推荐()

这篇文章主要介绍了Springboot项目因为kackson版本问题启动报错解决方案,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的...

SpringBoot启动报错Failed to determine a suitable driver class

2021-10-10阅读(3274)评论(0)推荐()

这篇文章主要介绍了SpringBoot启动报错Failed to determine a suitable driver class,小编觉得挺不错的,现在分享...

apache启动报错:the requested operation has Failed解决办法

2021-11-19阅读(6253)评论(0)推荐()

apache启动报错:the requested operation has Failed解决办法

PHP 启动报错如何解决

2021-10-08阅读(5348)评论(0)推荐()

PHP 启动时报错的情况,想必很多朋友都有遇到过吧,下面是具体的解决方法

Tomcat启动时报错:java.lang.UnsatisfiedLinkError的解决

2021-11-08阅读(5942)评论(0)推荐()

这篇文章主要跟大家介绍了在Tomcat启动时报错:java.lang.UnsatisfiedLinkError的解决方法,虽然这个错误不影响项目的启动运行,但是...

Linux安装ElasticSearch启动报错的解决方法

2021-09-19阅读(8597)评论(0)推荐()

Linux安装ElasticSearch后,ElasticSearch是不能用root用户启动的,以root用户启动会报错Refer to the log fo...

取消

有人回复邮件通知

提交评论

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐