Resolved NPE, now readObject is throwing an exception