title: Why am I getting nosuchfileextension error in apache spark?
body: <p>[![enter image description here][1]][1]
  [1]: https://i.stack.imgur.com/r5ePs.jpg</p>
  <p>I am running a code in cluster with 2 executors and 1 master node &quot;Standalone cluster&quot;. When I try to execute the jar file with <code>spark-submit</code> I get the following error &quot;refer to the image&quot;. But, initially I ran the program in <code>setMaster(&quot;local[num of threads]&quot;)</code> mode then the code was executed and did basic graph printing thing.
  I am posting my code as well. I tried to run the code in eclipse IDE too however I got warning there and the program doesn't terminate.</p>
  <pre><code>    public static void main(String[] args) throws IOException {
  
          SparkConf conf = new SparkConf().setMaster(&quot;spark://210.107.197.209:7077&quot;).setAppName(&quot;graph&quot;)
                  .set(&quot;spark.shuffle.service.enabled&quot;, &quot;false&quot;).set(&quot;spark.dynamicAllocation.enabled&quot;, &quot;false&quot;);
          @SuppressWarnings(&quot;resource&quot;)
          JavaSparkContext javaSparkContext = new JavaSparkContext(conf);
      
  
          ClassTag&lt;String&gt; stringTag = scala.reflect.ClassTag$.MODULE$.apply(String.class);
          @SuppressWarnings(&quot;unused&quot;)
          ClassTag&lt;Integer&gt; intTag = scala.reflect.ClassTag$.MODULE$.apply(Integer.class);
          ClassTag&lt;Double&gt; doubleTag = scala.reflect.ClassTag$.MODULE$.apply(Double.class);
  
          List&lt;Edge&lt;Double&gt;&gt; edges = new ArrayList&lt;&gt;();
          List&lt;Tuple2&lt;Object, String&gt;&gt; nodes = new ArrayList&lt;&gt;();
  
          String edgesInputFileName = &quot;Dataset/SFEdge.txt&quot;;
          String nodesInputFileName = &quot;Dataset/SFNodes.txt&quot;;
  
          readTextEdgeFile(edges, edgesInputFileName);
          readTextNodeFile(nodes, nodesInputFileName);
  
          JavaRDD&lt;Edge&lt;Double&gt;&gt; edgeRDD = javaSparkContext.parallelize(edges);
          JavaRDD&lt;Tuple2&lt;Object, String&gt;&gt; nodeRDD = javaSparkContext.parallelize(nodes);
  
          Graph&lt;String, Double&gt; graph = Graph.apply(nodeRDD.rdd(), edgeRDD.rdd(), &quot;&quot;, StorageLevel.MEMORY_ONLY(),
                  StorageLevel.MEMORY_ONLY(), stringTag, doubleTag);
  
  
  
          // graph.edges().toJavaRDD().foreach(x -&gt; System.out.println(&quot;SourceNode: &quot; +
          // x.srcId() + &quot; , DestinationNode: &quot;
          // + x.dstId() + &quot;, Distance SRC-DEST: &quot; + x.attr$mcD$sp()));
  
          graph.partitionBy(PartitionStrategy.RandomVertexCut$.MODULE$, 2);
  
          Graph&lt;Object, Double&gt; connectedComponents = graph.ops().connectedComponents();
          connectedComponents.vertices().toJavaRDD().collect().forEach(System.out::println);
          
  
      }
  
      public static boolean readTextEdgeFile(List&lt;Edge&lt;Double&gt;&gt; edgeList, String txtFileName)
              throws FileNotFoundException, IOException {
          String line = &quot;&quot;;
          String txtSplitBy = &quot; &quot;;
          boolean removedBOM = false;
          try (BufferedReader br = new BufferedReader(new FileReader(txtFileName))) {
              while ((line = br.readLine()) != null) {
                  String[] record = line.split(txtSplitBy);
                  if (record.length == 4) {
                      if (!removedBOM &amp;&amp; record[0] != &quot;0&quot;) {
  
                          record[0] = String.valueOf(0);
                          removedBOM = true;
  
                      }
                      edgeList.add(new Edge&lt;Double&gt;(Integer.parseInt(record[1]), Integer.parseInt(record[2]),
                              Double.parseDouble(record[3])));
  
                  }
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          return true;
  
      }
  
      public static boolean readTextNodeFile(List&lt;Tuple2&lt;Object, String&gt;&gt; nodeList, String txtFileName)
              throws FileNotFoundException, IOException {
          String line = &quot;&quot;;
          String txtSplitBy = &quot; &quot;;
          boolean removedBOM = false;
          long counter = 0L;
          try (BufferedReader br = new BufferedReader(new FileReader(txtFileName))) {
              while ((line = br.readLine()) != null) {
                  String[] record = line.split(txtSplitBy);
                  if (record.length == 4) {
                      if (!removedBOM &amp;&amp; record[0] != &quot;0&quot;) {
  
                          record[0] = String.valueOf(0);
                          removedBOM = true;
  
                      }
                      nodeList.add(new Tuple2&lt;Object, String&gt;(counter, record[0]));
                      counter++;
  
                  }
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          return true;
  
      }
  }
  </code></pre>