java.lang.NoClassDefFoundError: org/yaml [英] java.lang.NoClassDefFoundError: org/yaml

查看:45
本文介绍了java.lang.NoClassDefFoundError: org/yaml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用 Storm 尝试提交 Storm-starter 的新手,但是当我

I'm new in using storm trying to submit storm-starter but when i

mvn package 

我遇到了那个错误

java.lang.NoClassDefFoundError: org/yaml/snakeyaml/constructor/BaseConstructor, 
compiling:(word_count.clj:16:1)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3463)

链接中的 POM 文件

推荐答案

当遇到像你这样的 ClassPath 错误时,一个常见的问题是你可能会因为传递依赖而发生冲突;即,至少有两个工件提供了未找到类的不同版本,您需要排除冲突的一个.所以你必须识别碰撞,例如在 Maven 中:<代码>mvn 依赖项:树 -Dverbose并寻找碰撞工件,在你的情况下是uri:<代码>org/yaml/snakeyaml/constructor/BaseConstructor标识 maven 坐标,groupId=org.yaml 和 artifactId=snakeyaml,你会发现你的情况下的工件测试"提供了另一个snakeyaml,因此添加了一个排除项,就像你对该工件的依赖所做的那样:```

A common problem when getting a ClassPath error like the one you got, is that you might have a collision from transitive dependencies; i.e., there's at least two artifacts that are providing different versions of the Class Not Found, you need to exclude the colliding one. So you have to identify the collision, e.g. in maven do: mvn dependency:tree -Dverbose and look for the colliding artifact, in your case the uri: org/yaml/snakeyaml/constructor/BaseConstructor identifies maven coordinates, groupId=org.yaml, and artifactId=snakeyaml , you'll find that the artifact "testing" in your case was providing another snakeyaml and thus add an exclusion as you did to that artifact's dependency: ```

<exclusions>
  <exclusion>
    <groupId>org.yaml</groupId>
    <artifactId>snakeyaml</artifactId>
  </exclusion>
</exclusions>

```

这篇关于java.lang.NoClassDefFoundError: org/yaml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆