Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-6152

Spark does not support Java 8 compiled Scala classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.2.1
    • 1.6.0
    • Spark Core
    • None
    • Java 8+
      Scala 2.11

    Description

      Spark uses reflectasm to check Scala closures which fails if the user defined Scala closures are compiled to Java 8 class version

      The cause is reflectasm does not support Java 8
      https://github.com/EsotericSoftware/reflectasm/issues/35

      Workaround:
      Don't compile Scala classes to Java 8, Scala 2.11 does not support nor require any Java 8 features

      Stack trace:

      java.lang.IllegalArgumentException
      	at com.esotericsoftware.reflectasm.shaded.org.objectweb.asm.ClassReader.<init>(Unknown Source)
      	at com.esotericsoftware.reflectasm.shaded.org.objectweb.asm.ClassReader.<init>(Unknown Source)
      	at com.esotericsoftware.reflectasm.shaded.org.objectweb.asm.ClassReader.<init>(Unknown Source)
      	at org.apache.spark.util.ClosureCleaner$.org$apache$spark$util$ClosureCleaner$$getClassReader(ClosureCleaner.scala:41)
      	at org.apache.spark.util.ClosureCleaner$.getInnerClasses(ClosureCleaner.scala:84)
      	at org.apache.spark.util.ClosureCleaner$.clean(ClosureCleaner.scala:107)
      	at org.apache.spark.SparkContext.clean(SparkContext.scala:1478)
      	at org.apache.spark.rdd.RDD.map(RDD.scala:288)
      	at ...my Scala 2.11 compiled to Java 8 code calling into spark
      

      Attachments

        Activity

          People

            joshrosen Josh Rosen
            pyrolistical Ronald Chen
            Votes:
            8 Vote for this issue
            Watchers:
            20 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: