springboot启动报错:java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml

异常信息如下:

Exception in thread "main" java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml
  at com.motoros.web.runner.AppRunner.buildEnvForBuilder(AppRunner.java:51)
  at com.motoros.web.runner.AppRunner.appRun(AppRunner.java:32)
  at com.motoros.gxbm.ProviderApplication.main(ProviderApplication.java:24)
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml
  at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  ... 3 more

解决方式:在pom.xml文件中加入以下依赖坐标


<dependency>
    <groupId>org.yamlgroupId>
    <artifactId>snakeyamlartifactId>
    <version>1.23version>
dependency>

你可能感兴趣的:(Exception,Spring)