What can cause a java.util.noSuchElementException?
<p>I'm getting a <code>java.util.NoSuchElementException</code> when running the following code, and I can't identify the cause of it:</p>

<pre><code>package jBittorrentAPI;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;


public class ThreadTest {
    static Object[] elements;
    static ArrayList Users;
    public static String fileRead(){
        System.out.println("inside frs");
        //List Users = new ArrayList();
        Users = new ArrayList();
        System.out.println("after ");
        try {
            File file1 = new File("c:\\coms.txt");
            System.out.println("try");
            Scanner Filereader1 = new Scanner(file1);
            while (Filereader1.hasNextLine()) {
                //int i = 0;
                String Name = Filereader1.next();
                System.out.println("aftr string");
                Users.add(Name);

            }

          //elements = Users.toArray();
          // while(Users.iterator() != null){
          for (int a =0; a &lt;elements.length; a++) {
             System.out.println(elements[a]);
           }
        } catch (FileNotFoundException e) {
                System.out.println("error" + e);
        }
        return "hi";
    }

    public static void main(String[] args) {
        System.out.println("inside main");
        ThreadRun tr= new ThreadRun();
        Thread t= new Thread(tr);
        String s=fileRead();

        System.out.println(s);
         for(int i=0;i&lt;Users.size();i++)
         {
            System.out.println(Users.get(i));

             t.start();
             //System.out.println("Thread no is "+t.getId());
         }
    }
}

 class ThreadRun implements Runnable {

    static int loop_break=0;

    public void run() {
            System.out.println(loop_break);
            loop_break++;

    }
}
</code></pre>

<p>Would someone mind pointing out where I might be going wrong, or perhaps suggest ways to debug this?</p>
