support for Glassfish 4.0 class names and custom realm names. Added integration test.