java.lang.NoClassDefFoundError: org/apache/spark/sql/SparkSession$

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

you can change your scala version to 2.11.11

,
Expert tip

A few things cause this exception:
1) Check if you have all jars and if they're in the correct path.
2) Your classpath might be broken, you can define it in the command line with java -cp yourClassPath or at your IDE if you're using one.

Solutions on the web

via Stack Overflow by israel.zinc
, 9 months ago
org/apache/spark/sql/SparkSession$
java.lang.NoClassDefFoundError: org/apache/spark/sql/SparkSession$
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.mongodb.spark.MongoSpark$Builder.sparkContext(MongoSpark.scala:257)
at com.mongodb.spark.SparkContextFunctions.loadFromMongoDB(SparkContextFunctions.scala:50)
at undefined.SpaceExample$.main(SpaceWalk.scala:78)
at undefined.SpaceExample.main(SpaceWalk.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)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
2506 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.