java.lang.ClassNotFoundException: com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper

huangapple go评论107阅读模式
英文:

java.lang.ClassNotFoundException: com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper

问题

我正在尝试运行一个 Spark 作业。然而,每次我试图在本地运行它时,它都因为以下原因失败:

caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper$class
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)

我的 Pom 文件已经包含了 Jackson 依赖:

<dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.11.2</version>
</dependency>
<dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.11.2</version>
</dependency>
<dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.11.2</version>
</dependency>

我的 Scala 版本是 2.11.12,Spark 版本是 2.4.4。在网上搜索后,建议保持 jackson 依赖与版本匹配,而它们的确匹配。

有任何建议吗?

英文:

I am trying to run a spark job. However everytime I try to get it to run locally it fails because of

caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper$class
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)

My Pom File includes Jackson dependencies already

 &lt;dependency&gt;
        &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
        &lt;version&gt;2.11.2&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
        &lt;version&gt;2.11.2&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
        &lt;version&gt;2.11.2&lt;/version&gt;
    &lt;/dependency&gt;

My scala version is 2.11.12 and spark 2.4.4. Looking online, it was recommended jackson dependencies match and they do.

Any suggestions?

答案1

得分: 1

这解决了我的问题,运行得很顺利!
https://programming.vip/docs/resolution-of-jackson-version-conflict-in-spark-application.html

英文:

This solved my issue, worked like a charm!
https://programming.vip/docs/resolution-of-jackson-version-conflict-in-spark-application.html

huangapple
  • 本文由 发表于 2020年8月28日 08:54:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/63625991.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定