Fix possible NPE with GlassFish