In GlassFish, SecureAdmin is defined this way (with other, irrelevant details omitted here):
@configured
/**
- Represents the admin security settings for the domain.
*
*/
public interface SecureAdmin extends ConfigBeanProxy, Injectable {
@element
@create(value="enable-secure-admin-principal", decorator=SecureAdminPrincipal.CrDecorator.class, i18n=@i18n("enable.secure.admin.principal.command"))
@delete(value="disable-secure-admin-principal", resolver=SecureAdminPrincipal.Resolver.class, i18n=@i18n("disable.secure.admin.principal.command"))
@Listing(value="list-secure-admin-principals", i18n=@i18n("list.secure.admin.principals.command"))
public List getSecureAdminPrincipal();
@element
@create(value="enable-secure-admin-internal-user", decorator=SecureAdminInternalUser.CrDecorator.class, i18n=@i18n("enable.secure.admin.internal.user.command"))
@delete(value="disable-secure-admin-internal-user", resolver=TypeAndNameResolver.class, i18n=@i18n("disable.secure.admin.internal.user.command"))
@Listing(value="list-secure-admin-internal-users", i18n=@i18n("list.secure.admin.internal.user.command"))
public List getSecureAdminInternalUser();
Note that SecureAdmin is not annotated with @NotNull.
If I start the server in a newly-created domain (for which domain.xml contains no element), then run
asadmin list-secure-admin-principals
I get the expected empty results.
Next I run
asadmin enable-secure-admin-principal me
The domain.xml contains what I expect:
But if I run
asadmin list-secure-admin-principals
again I still get an empty list. Yet I can successfully run
asadmin disable-secure-admin-principal me
and it finds it and removes it.
On the other hand, if after the server start-up I do this
asadmin enable-secure-admin-principal me
asadmin list-secure-admin-principals
then the output contains an entry for "me" as expected.
It is as if the element is missing when the first "list" command runs, then the in-memory configuration is convinced that the element will never appear.
By the way, once I restart the server after doing the start/list/enable sequence then the list command works correctly.
Affected Versions
[2.1.*]