I have a server config where i have set the default-realm attribute on security-service to "ldaprealm".
Everytime i start Admin-GUI then the default realm gets reset to "filerealm" which happens to be the
default when nothing was explicitly given.
If i try to see the value of default-realm in GUI after loading however it does show the correct
value"ldaprealm". But the internal RuntimeValue in Security Realm.java has been changed to "filerealm"
I debugged this and found that the issue is in AMX code. Attached are call stacks when admin gui is
loading to show the issue.
Steps to reproduce :
1. Open Admin GUI and under Configuration->Security set the default realm to something otherthan
2. You can for example create another realm in GUI first (which can be another filerealm with different
name) and set that as the default.
3. Now restart the server and access admin gui in the browser.
After the browser has loaded Admin-GUI, the default realm in the security runtime would be changed
back to original filerealm and not the one created in step 2.
I also notice that the call to Realm.setDefaultRealm() happens many many times during loading of
Admin GUI which seems somehow unnecessary.
Marking as P2 since without this being fixed we are blocked on the Oracle Access Manager integration
where we require the default glassfish realm to be an ldaprealm. And things only work as long as the
Admin GUI is not loaded.