The error was java.util.NoSuchElementException

No line was found when using file.next()
Scanner (Java Platform SE 7 )

The while(file.hasNextLine()) loop will catch this situation, but I think...