From: <glassfish_at_javadesktop.org>
Date: Tue, 07 Sep 2010 04:52:58 PDT
The <as-context> element under ior-security-config (sun-ejb-jar.xml) can specify a realm. If that realm is specified then that is the realm which will be used for authentication on the server (it will override any realm that was specified during client side programmatic login)
But when you do not have a realm specified then GlassFish tries to use the realm that was specified as part of ProgrammaticLogin. If No realm was specified for ProgrammaticLogin on the client side then the default realm is used.