title: Spark UI showing 0 cores even when setting cores in App
body: <p>I am having a strange issue with running an application off of the spark master url where the UI is reporting a "STATE" of "WAITING" indefinitely as 0 cores are showing up under the RUNNING APPLICATIONs table no matter what I configure the core count to be.  </p>
  
  <p>Ive configured my app with the following settings where spark.max.cores = 2 &amp; spark.default.cores = 2 &amp; memory set to 3GB.  The machine is an enterprise class server with over 24 cores.  </p>
  
  <pre><code>        SparkConf conf = new SparkConf()
              .setAppName(Properties.getString("SparkAppName"))
              .setMaster(Properties.getString("SparkMasterUrl"))
              .set("spark.executor.memory", Properties.getString("SparkExecMem"))
              .set("spark.cores.max",Properties.getString("SparkCores"))
              .set("spark.driver.memory",Properties.getString("SparkDriverMem"))
              .set("spark.eventLog.enabled", "true")
              .set("spark.deploy.defaultCores",Properties.getString("SparkDefaultCores"));
  
      //Set Spark context
      JavaSparkContext sc = new JavaSparkContext(conf);
      JavaStreamingContext jssc = new JavaStreamingContext(sc, new Duration(5000));
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/znMGB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/znMGB.png" alt="enter image description here"></a></p>
  
  <p>Spark WebUI states zero cores used and indefinite wait no tasks running.  The application is also using NO MEMORY whatsoever during run time or cores and immediately hits a status of waiting when starting.  </p>
  
  <pre><code>Spark-defaults.conf 
  spark.yarn.max_executor.failures         3
  spark.yarn.applicationMaster.waitTries   10
  spark.history.kerberos.keytab    none
  spark.yarn.preserve.staging.files        False
  spark.yarn.submit.file.replication       3
  spark.history.kerberos.principal         none
  spark.yarn.historyServer.address         {removed}.{removed}.com:18080
  spark.yarn.scheduler.heartbeat.interval-ms       5000
  spark.yarn.queue         default
  spark.yarn.containerLauncherMaxThreads   25
  spark.yarn.driver.memoryOverhead         384
  spark.history.ui.port    18080
  spark.yarn.services      org.apache.spark.deploy.yarn.history.YarnHistoryService
  spark.yarn.max.executor.failures         3
  spark.driver.extraJavaOptions     -Dhdp.version=2.2.6.0-2800
  spark.history.provider   org.apache.spark.deploy.yarn.history.YarnHistoryProvider
  spark.yarn.am.extraJavaOptions    -Dhdp.version=2.2.6.0-2800
  spark.yarn.executor.memoryOverhead       384
  </code></pre>
  
  <p>Submit script</p>
  
  <p><code>spark-submit --class {removed}.{removed}.{removed}.sentiment.MainApp --deploy-mode client  /path/to/jar</code></p>
  
  <p><strong>EDITED: 2/3/2016</strong>
  After running with --master yarn-cluster I am receiving this in the yarn logs error.  I have also included my updated submit configuration</p>
  
  <p>Submit Configuration</p>
  
  <pre><code>spark-submit --class com.removed.removed.sentiment.MainApp 
  --master yarn-cluster --supervise 
  /data04/dev/removed/spark/twitternpi/npi.sentiment-1.0-SNAPSHOT-shaded.jar 
  --jars /usr/hdp/2.2.6.0-2800/spark/lib/datanucleus-core-3.2.10.jar,/usr/hdp/2.2.6.0-2800/spark/lib/datanucleus-api-jdo-3.2.6.jar,/usr/hdp/2.2.6.0-2800/spark/lib/datanucleus-rdbms-3.2.9.jar,/usr/hdp/2.2.6.0-2800/spark/lib/spark-1.2.1.2.2.6.0-2800-yarn-shuffle.jar,/usr/hdp/2.2.6.0-2800/spark/lib/spark-assembly-1.2.1.2.2.6.0-2800-hadoop2.6.0.2.2.6.0-2800.jar
  </code></pre>
  
  <p>Error Message</p>
  
  <pre><code>   ClassLoaderResolver for class "" gave error on creation : {1}
  org.datanucleus.exceptions.NucleusUserException: ClassLoaderResolver for class "" gave error on creation : {1}
      at org.datanucleus.NucleusContext.getClassLoaderResolver(NucleusContext.java:1087)
      at org.datanucleus.PersistenceConfiguration.validatePropertyValue(PersistenceConfiguration.java:797)
      at org.datanucleus.PersistenceConfiguration.setProperty(PersistenceConfiguration.java:714)
      at org.datanucleus.PersistenceConfiguration.setPersistenceProperties(PersistenceConfiguration.java:693)
      at org.datanucleus.NucleusContext.&lt;init&gt;(NucleusContext.java:273)
      at org.datanucleus.NucleusContext.&lt;init&gt;(NucleusContext.java:247)
      at org.datanucleus.NucleusContext.&lt;init&gt;(NucleusContext.java:225)
  </code></pre>