I have two cursors which are used to display details in UI.
headerCur = (ResultSet) cstmt.getObject(4);
serialCur = (ResultSet) cstmt.getObject(5); 
When the user enters a wrong value, it goes to serialCur.next().
while (serialCur.next()) {
    // ...
} 
However, it throws a NullPointerException.
I have logged and found that the serialCur is not null, but the next() call throws null pointer exception anyway.
How is this caused and how can I solve it?
 
     
    