title: Multiple SparkContext detected in the same JVM
body: <p>according my <a href="https://stackoverflow.com/questions/34877878/creation-of-javardd-object-has-failed">last question</a> I have to define the Multiple SparkContext for my unique JVM.</p>
  
  <p>I did it in the next way (using Java):</p>
  
  <pre><code>SparkConf conf = new SparkConf();
  conf.setAppName("Spark MultipleContest Test");
  conf.set("spark.driver.allowMultipleContexts", "true");
  conf.setMaster("local");
  </code></pre>
  
  <p>After that I create the next source code:</p>
  
  <pre><code>SparkContext sc = new SparkContext(conf);
  SQLContext sqlContext = new org.apache.spark.sql.SQLContext(sc);
  </code></pre>
  
  <p>and later in the code:</p>
  
  <pre><code>JavaSparkContext ctx = new JavaSparkContext(conf);
  JavaRDD&lt;Row&gt; testRDD = ctx.parallelize(AllList);
  </code></pre>
  
  <p>After the code executing I got next error message:</p>
  
  <pre><code>16/01/19 15:21:08 WARN SparkContext: Multiple running SparkContexts detected in the same JVM!
  org.apache.spark.SparkException: Only one SparkContext may be running in this JVM (see SPARK-2243). To ignore this error, set spark.driver.allowMultipleContexts = true. The currently running SparkContext was created at:
  org.apache.spark.SparkContext.&lt;init&gt;(SparkContext.scala:81)
  test.MLlib.BinarryClassification.main(BinaryClassification.java:41)
      at org.apache.spark.SparkContext$$anonfun$assertNoOtherContextIsRunning$1.apply(SparkContext.scala:2083)
      at org.apache.spark.SparkContext$$anonfun$assertNoOtherContextIsRunning$1.apply(SparkContext.scala:2065)
      at scala.Option.foreach(Option.scala:236)
      at org.apache.spark.SparkContext$.assertNoOtherContextIsRunning(SparkContext.scala:2065)
      at org.apache.spark.SparkContext$.setActiveContext(SparkContext.scala:2151)
      at org.apache.spark.SparkContext.&lt;init&gt;(SparkContext.scala:2023)
      at org.apache.spark.api.java.JavaSparkContext.&lt;init&gt;(JavaSparkContext.scala:61)
      at test.MLlib.BinarryClassification.main(BinaryClassification.java:105)
  </code></pre>
  
  <p>The numbers <code>41</code> and <code>105</code> are the lines, where both objects are defined in Java code. My question is, is it possible to execute multiple SparkContext on the same JVM and how to do it, if I already use the <code>set</code>-method ? </p>