• java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: scala/runtime/java8/JFunction1$mcII$sp


    报错信息:

    Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: scala/runtime/java8/JFunction1$mcII$sp at com.henvealf.spark.learn.mapPartitonsTest$.main(mapPartitonsTest.scala:33) at com.henvealf.spark.learn.mapPartitonsTest.main(mapPartitonsTest.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:736) at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:185) at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:210) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:124) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala) Caused by: java.lang.NoClassDefFoundError: scala/runtime/java8/JFunction1$mcII$sp ... 11 more Caused by: java.lang.ClassNotFoundException: scala.runtime.java8.JFunction1$mcII$sp at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 11 more

    这是由于版本不匹配造成的: 
    本地: Scala 2.12 
    集群: Spark 2.11 Scala 2.11.8 
    把本地的Scala 改成 2.11.8 重新打包, 记住要把原来的Scala 2.12 SDK 换成 Scala 2.11.8 SDK

    备注:

    除了修改Scala SDK的版本还需要修改pom.xml的版本号:

    <properties>
    <scala.version>2.11.8</scala.version>
    </properties>
  • 相关阅读:
    杭电2095--find your present (2) (异或)
    南阳168--房间安排(区间覆盖)
    南阳954--N!(数学)
    南阳--69(数的长度)
    杭电--N!(大数)
    杭电1005--Number Sequence
    杭电1108--最小公倍数
    动态规划:最长上升子序列(二分算法 nlogn)
    动态规划:最长上升子序列之基础(经典算法 n^2)
    vector函数用法
  • 原文地址:https://www.cnblogs.com/antyi/p/7624783.html
Copyright © 2020-2023  润新知