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

Thrown java.lang.NoClassDefFoundError when using spark-submit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.1
    • None
    • Build, Kubernetes
    • None

    Description

      Got NoClassDefFoundError when run spark-submit to submit Spark app to K8S cluster.

      Master, branch-3.0 are okay. Branch-3.1 is affected.

      How to reproduce:

      1. Using sbt to build Spark with Kubernetes (-Pkubernetes)
      2. Run spark-submit to submit to K8S cluster
      3. Get the following exception

      21/04/20 16:33:37 INFO SparkKubernetesClientFactory: Auto-configuring K8S client using current context from users K8S config file                                 
      Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/dataformat/yaml/YAMLFactory                                                      
              at io.fabric8.kubernetes.client.internal.KubeConfigUtils.parseConfigFromString(KubeConfigUtils.java:46)                                                   
              at io.fabric8.kubernetes.client.Config.loadFromKubeconfig(Config.java:564)                                                                                
              at io.fabric8.kubernetes.client.Config.tryKubeConfig(Config.java:530)                                                                                     
              at io.fabric8.kubernetes.client.Config.autoConfigure(Config.java:264)                                                                                     
              at io.fabric8.kubernetes.client.Config.<init>(Config.java:230)                                                                                            
              at io.fabric8.kubernetes.client.Config.<init>(Config.java:224)                                                                                            
              at io.fabric8.kubernetes.client.Config.autoConfigure(Config.java:259)                                                                                             at org.apache.spark.deploy.k8s.SparkKubernetesClientFactory$.createKubernetesClient(SparkKubernetesClientFactory.scala:80)                                
              at org.apache.spark.deploy.k8s.submit.KubernetesClientApplication.$anonfun$run$2(KubernetesClientApplication.scala:207)                                   
              at org.apache.spark.util.Utils$.tryWithResource(Utils.scala:2621)                                                                                         
              at org.apache.spark.deploy.k8s.submit.KubernetesClientApplication.run(KubernetesClientApplication.scala:207)                                              
              at org.apache.spark.deploy.k8s.submit.KubernetesClientApplication.start(KubernetesClientApplication.scala:179)                                            
              at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:951)                                                
              at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)                                                                                 
              at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)                                                                                      
              at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)
              at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1030)
              at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1039)
              at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
      Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.dataformat.yaml.YAMLFactory
              at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
              ... 19 more 

      Attachments

        Activity

          People

            Unassigned Unassigned
            viirya L. C. Hsieh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: