Я недавно загрузил Scala IDE для Eclipse для проекта Spark / Scala. Для этого я создал проект Maven и добавил зависимости Spark-core. Затем я написал базовый код Spark, чтобы создать RDD из массива и, наконец, собрать его. После запуска кода на консоли выдается сообщение об ошибке «java.lang.NoClassDefFoundError: com / fastxml / jackson / module / paranamer / ParanamerAnnotationIntrospector».
Искровой код:
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
object Test {
def main(args : Array[String]) : Unit = {
println("Begining of the code")
val sparkConf = new SparkConf()
sparkConf.setAppName("New app")
sparkConf.setMaster("local")
val sc = new SparkContext(sparkConf)
val array = Array(1,2,3,4,5)
val arrayRDD = sc.parallelize(array, 2)
arrayRDD.collect
println("Ending of the code")
}
}
Maven Зависимость:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.talentorigin</groupId>
<artifactId>SparkCourse</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-core -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.12</artifactId>
<version>2.4.3</version>
</dependency>
</dependencies>
</project>
Ошибка консоли:
Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/module/paranamer/ParanamerAnnotationIntrospector
at org.apache.spark.rdd.RDDOperationScope$.<init>(RDDOperationScope.scala:82)
at org.apache.spark.rdd.RDDOperationScope$.<clinit>(RDDOperationScope.scala)
at org.apache.spark.SparkContext.withScope(SparkContext.scala:699)
at org.apache.spark.SparkContext.parallelize(SparkContext.scala:716)
at Test$.main(Test.scala:17)
at Test.main(Test.scala)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.module.paranamer.ParanamerAnnotationIntrospector
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
Тег проблемы Затмения:
Failure to transfer com.fasterxml.jackson.module:jackson-module-paranamer:jar:2.7.9 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Failure to transfer net.sf.py4j:py4j:jar:0.10.7 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Missing artifact com.fasterxml.jackson.module:jackson-module-paranamer:jar:2.7.9
Missing artifact net.sf.py4j:py4j:jar:0.10.7
The container 'Maven Dependencies' references non existing library 'C:\Users\AniRudh\.m2\repository\com\fasterxml\jackson\module\jackson-module-paranamer\2.7.9\jackson-module-paranamer-2.7.9.jar'
Я новичок в работе с Maven.
Пожалуйста, помогите мне решить эту проблему.