<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Executing application with spark-class in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14472#M2129</link>
    <description>&lt;P&gt;Here is the command I am running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$SPARK_HOME/bin/spark-class org.apache.spark.deploy.yarn.Client --jar ~/samples/syn-spark-project-0.0.1-SNAPSHOT.jar --class spark.WorkCountJob --args yarn-standalone --args input/hello.txt --args output.txt&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My cluster is setup with Yarn, and the syn-spark-project is a jar that I assembled using the jar stored in the $SPARK_HOME directory on my cluster.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking at the "Running Spark Applications" entry in the documentation.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jun 2014 14:05:23 GMT</pubDate>
    <dc:creator>Thatcher</dc:creator>
    <dc:date>2014-06-30T14:05:23Z</dc:date>
    <item>
      <title>Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14468#M2127</link>
      <description>&lt;P&gt;I have a newly installed CDH5 cluster with Spark configured and installed.&amp;nbsp; I have verified that I can log into the Spark interactive shell, but as of yet I have been unable to submit any spark application via spark-class.&amp;nbsp; Whenever I do, I get the following exception:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times" size="1" color="black"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/client/api/impl/YarnClientImpl&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.ClassLoader.defineClass1(Native Method)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.ClassLoader.defineClass(ClassLoader.java:800)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.net.URLClassLoader.access$100(URLClassLoader.java:71)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.net.URLClassLoader$1.run(URLClassLoader.java:361)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.net.URLClassLoader$1.run(URLClassLoader.java:355)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.net.URLClassLoader.findClass(URLClassLoader.java:354)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.ClassLoader.loadClass(ClassLoader.java:425)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.lang.ClassLoader.loadClass(ClassLoader.java:358)&lt;BR /&gt;&lt;BR /&gt;The instructions I am following are here:&lt;BR /&gt;&lt;A target="_blank" href="https://email.mlp.com/owa/redir.aspx?C=V2iX-O_hQEqM9srHfJIuFmN7jQX6Z9EIOicT4oGP0gAyi3BWMeIo0TCJNCeJos1LyL-Fr0xNYx4.&amp;amp;URL=http%3a%2f%2fwww.cloudera.com%2fcontent%2fcloudera-content%2fcloudera-docs%2fCDH5%2flatest%2fCDH5-Installation-Guide%2fcdh5ig_running_spark_apps.html"&gt;http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/CDH5-Installation-Guide/cdh5ig_running_spark_apps.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:01:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14468#M2127</guid>
      <dc:creator>Thatcher</dc:creator>
      <dc:date>2022-09-16T09:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14470#M2128</link>
      <description>&lt;P&gt;Can you share the exact command you are running?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The link you supplied goes through a redirector we can't access, and the important part got cut off. Maybe you can clarify what page you are looking at under the installation guide.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 13:43:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14470#M2128</guid>
      <dc:creator>srowen</dc:creator>
      <dc:date>2014-06-30T13:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14472#M2129</link>
      <description>&lt;P&gt;Here is the command I am running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$SPARK_HOME/bin/spark-class org.apache.spark.deploy.yarn.Client --jar ~/samples/syn-spark-project-0.0.1-SNAPSHOT.jar --class spark.WorkCountJob --args yarn-standalone --args input/hello.txt --args output.txt&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My cluster is setup with Yarn, and the syn-spark-project is a jar that I assembled using the jar stored in the $SPARK_HOME directory on my cluster.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking at the "Running Spark Applications" entry in the documentation.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:05:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14472#M2129</guid>
      <dc:creator>Thatcher</dc:creator>
      <dc:date>2014-06-30T14:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14474#M2130</link>
      <description>&lt;P&gt;(I think you have a typo in "WorkCountJob" but that's not the issue yet)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;source /etc/spark/conf/spark-env.sh&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:09:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14474#M2130</guid>
      <dc:creator>srowen</dc:creator>
      <dc:date>2014-06-30T14:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14476#M2131</link>
      <description>&lt;P&gt;Yep, source spark-env and set the SPARK_JAR environment variable as the instructions suggested (and I used the same jar during the compilation of my jar),&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:23:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14476#M2131</guid>
      <dc:creator>Thatcher</dc:creator>
      <dc:date>2014-06-30T14:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14478#M2132</link>
      <description>&lt;P&gt;How did you compile your jar file -- against which Spark and Hadoop deps?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like something is missing from the classpath.&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Try executing this first and then re-running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN&gt;export SPARK&lt;/SPAN&gt;_PRINT_LAUNCH_COMMAND=1&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;That ought to make it print the command including classpath.&lt;/P&gt;&lt;P class="p1"&gt;The error is from the local driver, not the app on the cluster right?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:30:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14478#M2132</guid>
      <dc:creator>srowen</dc:creator>
      <dc:date>2014-06-30T14:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14480#M2133</link>
      <description>&lt;P&gt;I am compiling the jar again the Hadoop 0.20.2 dependency and the Spark jar that is loaded on the cluster (the same point I am pointing the spark-class command to).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not think this particular error has anything to do with my compiled jar though, because when I run the spark-class while leaving off the jar argument, it fails with the same error (ie, looks like it does not even get to parsing the arguments).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I executed that with the debug command you supplied, here is what I got:&lt;/P&gt;&lt;P&gt;10:32 AM ~/lib/spark-0.9.0-incubating/bin: export SPARK_PRINT_LAUNCH_COMMAND=1&lt;BR /&gt;10:34 AM ~/lib/spark-0.9.0-incubating/bin: $SPARK_HOME/bin/spark-class org.apache.spark.deploy.yarn.Client&lt;BR /&gt;Spark Command: java -cp :/opt/cloudera/parcels/CDH-5.0.1-1.cdh5.0.1.p0.47/lib/spark/conf:/opt/cloudera/parcels/CDH-5.0.1-1.cdh5.0.1.p0.47/lib/spark/assembly/lib/*:/opt/cloudera/parcels/CDH-5.0.1-1.cdh5.0.1.p0.47/lib/spark/examples/lib/*:/etc/hadoop/conf:/home/tclay/tools/hadoop-0.20.2/*:/home/tclay/tools/hadoop-0.20.2/../hadoop-hdfs/*:/home/tclay/tools/hadoop-0.20.2/../hadoop-yarn/*:/home/tclay/tools/hadoop-0.20.2/../hadoop-mapreduce/*:/opt/cloudera/parcels/CDH-5.0.1-1.cdh5.0.1.p0.47/lib/spark/lib/scala-library.jar:/opt/cloudera/parcels/CDH-5.0.1-1.cdh5.0.1.p0.47/lib/spark/lib/scala-compiler.jar:/opt/cloudera/parcels/CDH-5.0.1-1.cdh5.0.1.p0.47/lib/spark/lib/jline.jar -Djava.library.path=/opt/cloudera/parcels/CDH-5.0.1-1.cdh5.0.1.p0.47/lib/spark/lib:/home/tclay/tools/hadoop-0.20.2/lib/native -Xms512m -Xmx512m org.apache.spark.deploy.yarn.Client&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/client/api/impl/YarnClientImpl&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.lang.ClassLoader.defineClass1(Native Method)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.lang.ClassLoader.defineClass(ClassLoader.java:800)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.net.URLClassLoader.access$100(URLClassLoader.java:71)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.net.URLClassLoader$1.run(URLClassLoader.java:361)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.net.URLClassLoader$1.run(URLClassLoader.java:355)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.net.URLClassLoader.findClass(URLClassLoader.java:354)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.lang.ClassLoader.loadClass(ClassLoader.java:425)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.lang.ClassLoader.loadClass(ClassLoader.java:358)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)&lt;BR /&gt;Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.yarn.client.api.impl.YarnClientImpl&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.net.URLClassLoader$1.run(URLClassLoader.java:366)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.net.URLClassLoader$1.run(URLClassLoader.java:355)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.net.URLClassLoader.findClass(URLClassLoader.java:354)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.lang.ClassLoader.loadClass(ClassLoader.java:425)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.lang.ClassLoader.loadClass(ClassLoader.java:358)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:36:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14480#M2133</guid>
      <dc:creator>Thatcher</dc:creator>
      <dc:date>2014-06-30T14:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14482#M2134</link>
      <description>&lt;P&gt;OK, I meant what are the Maven / SBT deps, but in any event I think Hadoop 0.20.2 is the problem. CDH5 is Hadoop 2.3, and the supplied Spark works with that. Your classpath on your cluster shows you've got Hadoop 0.20.2 classes also in the mix somehow. I don't know where those are coming from? that is the problem.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:38:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14482#M2134</guid>
      <dc:creator>srowen</dc:creator>
      <dc:date>2014-06-30T14:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Executing application with spark-class</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14484#M2135</link>
      <description>&lt;P&gt;Perfect - Hadoop home was pointing to the wrong place, that was being picked up.&amp;nbsp; I am able to submit applications just fine now.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:44:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Executing-application-with-spark-class/m-p/14484#M2135</guid>
      <dc:creator>Thatcher</dc:creator>
      <dc:date>2014-06-30T14:44:15Z</dc:date>
    </item>
  </channel>
</rss>

