eWhile catching exceptions is this necessary to check if the error message is not null to avoid null pointer exception? Another words, is the if (e!=null) part needed? or e is always not null?
try {
...
} catch(Exception e) {
if (e != null) {
System.err.println("Error: " + e.getMessage());
}
}