<?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: I am unable to run a spark job successfully using Yarn Rest API approach. It gives ClassCastException: org.apache.hadoop.conf.Configuration cannot be cast to org.apache.hadoop.yarn.conf.YarnConfiguration. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/I-am-unable-to-run-a-spark-job-successfully-using-Yarn-Rest/m-p/230946#M192793</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11608/ssharma.html" nodeid="11608"&gt;@ssharma&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Following is the command I use to submit the spark job :&lt;/P&gt;&lt;P&gt;{{JAVA_HOME}}/bin/java -Xmx1024m org.apache.spark.deploy.yarn.ApplicationMaster --class 'org.apache.spark.examples.SparkPi' --jar AppMaster.jar 1&amp;gt;&amp;lt;LOG_DIR&amp;gt;/AppMaster.stdout 2&amp;gt;&amp;lt;LOG_DIR&amp;gt;/AppMaster.stderr.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have mentioned the payload in the question only where I have used this command.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Although when I use the spark-submit (from the payload)  I am able to run the spark job successfully. But I think this is a hack as it submits two different jobs, first one because of my yarn rest API and then internally the second one because of the spark command which is mentioned in the payload. Following is the spark submit command :&lt;/P&gt;&lt;P&gt;{{SPARK_HOME}}/bin/spark-submit --class org.apache.spark.examples.SparkPi --master yarn --deploy-mode cluster --driver-memory 1g --executor-memory 1g --executor-cores 1 /tmp/spark-examples_2.11-2.1.0.2.6.0.3-8.jar 10&lt;/P&gt;&lt;P&gt;Hence I wanted to run a job successfully using java command.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 12:10:20 GMT</pubDate>
    <dc:creator>abhinavkumar219</dc:creator>
    <dc:date>2018-06-20T12:10:20Z</dc:date>
  </channel>
</rss>

