made changes to make compatible with glassfish v2.1.1