better error handling
fixed a file handle leak
more recent version of Glassfish appear to add "_NNNN" after "loader"
more recent versions of Jenkins uses "classes.jar" for plugins
adding one more check