Support Questions

Find answers, ask questions, and share your expertise

spark-submit exception

avatar
Explorer

./spark-submit --class "SimpleApp" --master local[4] /home/cloudera/Downloads/simple-project_2.10-1.0.jar dp.txt
java.lang.ClassNotFoundException: SimpleApp
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:538)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:166)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:189)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:110)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/lib/zookeeper/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/jars/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

1 ACCEPTED SOLUTION

avatar
Explorer

Its resolved, Thank you so much, CLASS is missing from the jar

View solution in original post

6 REPLIES 6

avatar
Master Collaborator

Please give more information than just a command line and stack trace. You don't have "SimpleApp" in that JAR, or it's not the fully qualified name of the class.

avatar
Explorer
i have created SimpleApp.scala and build a jar on top of it by sbt package command in windows and ran this command ./spark-submit --class "SimpleApp" --master local[4] /home/example/SL/simple-project_2.10-1.0.jar , its giving javaclassnotfoundexception not sure how to resolve it, please help me out

avatar
Explorer

JAR exists , correct i too believe it's not the fully qualified name of the class, how do we set fully qualified name of the class, please suggest

avatar
Explorer

Its resolved, Thank you so much, CLASS is missing from the jar

avatar
New Contributor

How did you resolve it. after 'sbt package' or 'sbt clean package'. how can I make class into jar?

avatar
New Contributor

where did you add the CLASS?