Looking at the error, you're getting a
NullPointerException
on the following line:
reader.close();
That means the
reader
object is
null
, which suggests you have another error being thrown on one of the lines before the reader is created.
Check the
reader
object for
null
before trying to call the
close
method:
if (reader != null) { reader.close(); }
You'll then be able to see the real error, which will let you diagnose and resolve the problem.