Adjusted application to be compatible with Glassfish4