Buggy code:
public static final SimpleAttributeDefinition MANAGEMENT_MICRO_VERSION = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . MANAGEMENT_MICRO_VERSION , ModelType . INT , false ) . setValidator ( new org . jboss . as . controller . operations . validation . IntRangeValidator ( 0 ) ) . build ( ) ; public static final SimpleAttributeDefinition PROFILE_NAME = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . PROFILE_NAME , ModelType . STRING , false ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final SimpleAttributeDefinition NULL_PROFILE_NAME = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . PROFILE_NAME , ModelType . STRING , true ) . build ( ) ; public static final SimpleAttributeDefinition SERVER_STATE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . PROCESS_STATE , ModelType . STRING ) . setStorageRuntime ( ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final SimpleAttributeDefinition PROCESS_TYPE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . PROCESS_TYPE , ModelType . STRING ) . setStorageRuntime ( ) . setValidator ( ServerRootResourceDefinition . NOT_NULL_STRING_LENGTH_ONE_VALIDATOR ) . build ( ) ; public static final SimpleAttributeDefinition LAUNCH_TYPE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ServerDescriptionConstants . LAUNCH_TYPE , ModelType . STRING ) . setValidator ( new org . jboss . as . controller . operations . validation . EnumValidator < LaunchType > ( LaunchType . class , false , false ) ) . setStorageRuntime ( ) . build ( ) ; public static final AttributeDefinition RUNNING_MODE = org . jboss . as . controller . SimpleAttributeDefinitionBuilder . create ( ModelDescriptionConstants . RUNNING_MODE , ModelType . STRING ) . setValidator ( new org . jboss . as . controller . operations . validation . EnumValidator < org . jboss . as . controller . RunningMode > ( org . jboss . as . controller . RunningMode . class , false , false ) ) . setStorageRuntime ( ) . build ( ) ; private final boolean isDomain ; private final ContentRepository contentRepository ; private final ExtensibleConfigurationPersister extensibleConfigurationPersister ; private final ServerEnvironment serverEnvironment ; private final ControlledProcessState processState ; private final RunningModeControl runningModeControl ; private final AbstractVaultReader vaultReader ; private final ExtensionRegistry extensionRegistry ; private final boolean parallelBoot ; private final PathManagerService pathManager ; private final OperationIDUpdater operationIDUpdater ; private final DelegatingConfigurableAuthorizer authorizer ; private final ManagedAuditLogger auditLogger ; public ServerRootResourceDefinition ( final ContentRepository contentRepository , final ExtensibleConfigurationPersister extensibleConfigurationPersister , final ServerEnvironment serverEnvironment , final ControlledProcessState processState , final RunningModeControl runningModeControl , final AbstractVaultReader vaultReader , final ExtensionRegistry extensionRegistry , final boolean parallelBoot , final PathManagerService pathManager , final DomainServerCommunicationServices . OperationIDUpdater operationIDUpdater , final DelegatingConfigurableAuthorizer authorizer , final ManagedAuditLogger auditLogger ) { } @ Override public void registerOperations ( ManagementResourceRegistration resourceRegistration ) { GlobalOperationHandlers . registerGlobalOperations ( resourceRegistration , STANDALONE_SERVER ) ; if ( ( serverEnvironment ) != null ) { resourceRegistration . registerOperationHandler ( DEFINITION , INSTANCE ) ; } else { resourceRegistration . registerOperationHandler ( DEFINITION , INSTANCE ) ; } resourceRegistration . registerOperationHandler ( CompositeOperationHandler . DEFINITION , CompositeOperationHandler . INSTANCE , false ) ; XmlMarshallingHandler xmh = new XmlMarshallingHandler ( extensibleConfigurationPersister ) ; resourceRegistration . registerOperationHandler ( XmlMarshallingHandler . DEFINITION , xmh ) ; resourceRegistration . registerOperationHandler ( NamespaceAddHandler . DEFINITION , NamespaceAddHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( NamespaceRemoveHandler . DEFINITION , NamespaceRemoveHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( SchemaLocationAddHandler . DEFINITION , SchemaLocationAddHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( SchemaLocationRemoveHandler . DEFINITION , SchemaLocationRemoveHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( ValidateAddressOperationHandler . DEFINITION , ValidateAddressOperationHandler . INSTANCE , false ) ; DeploymentUploadBytesHandler . register ( resourceRegistration , contentRepository ) ; DeploymentUploadURLHandler . register ( resourceRegistration , contentRepository ) ; DeploymentUploadStreamAttachmentHandler . register ( resourceRegistration , contentRepository ) ; resourceRegistration . registerOperationHandler ( REPLACE_DEPLOYMENT_DEFINITION , DeploymentReplaceHandler . create ( contentRepository , vaultReader ) ) ; resourceRegistration . registerOperationHandler ( FULL_REPLACE_DEPLOYMENT_DEFINITION , DeploymentFullReplaceHandler . create ( contentRepository , vaultReader ) ) ; if ( ! ( isDomain ) ) { SnapshotDeleteHandler snapshotDelete = new SnapshotDeleteHandler ( extensibleConfigurationPersister ) ; resourceRegistration . registerOperationHandler ( SnapshotDeleteHandler . DEFINITION , snapshotDelete ) ; SnapshotListHandler snapshotList = new SnapshotListHandler ( extensibleConfigurationPersister ) ; resourceRegistration . registerOperationHandler ( SnapshotListHandler . DEFINITION , snapshotList ) ; SnapshotTakeHandler snapshotTake = new SnapshotTakeHandler ( extensibleConfigurationPersister ) ; resourceRegistration . registerOperationHandler ( SnapshotTakeHandler . DEFINITION , snapshotTake ) ; } resourceRegistration . registerOperationHandler ( ServerRestartRequiredHandler . DEFINITION , ServerRestartRequiredHandler . INSTANCE ) ; resourceRegistration . registerOperationHandler ( ResolveExpressionHandler . DEFINITION , ResolveExpressionHandler . INSTANCE , false ) ; resourceRegistration . registerOperationHandler ( SpecifiedInterfaceResolveHandler . DEFINITION , SpecifiedInterfaceResolveHandler . INSTANCE ) ; <START_BUG> resourceRegistration . registerOperationHandler ( WhoAmIOperation . DEFINITION , WhoAmIOperation . INSTANCE , true ) ; <END_BUG> resourceRegistration . registerOperationHandler ( RootResourceHack . DEFINITION , RootResourceHack . INSTANCE ) ; if ( isDomain ) { final ServerDomainProcessReloadHandler reloadHandler = new ServerDomainProcessReloadHandler ( Services . JBOSS_AS , runningModeControl , processState , operationIDUpdater ) ; resourceRegistration . registerOperationHandler ( DOMAIN_DEFINITION , reloadHandler , false ) ; resourceRegistration . registerOperationHandler ( SetServerGroupHostHandler . DEFINITION , SetServerGroupHostHandler . INSTANCE ) ; } else { final ServerProcessReloadHandler reloadHandler = new ServerProcessReloadHandler ( Services . JBOSS_AS , runningModeControl , processState ) ; resourceRegistration . registerOperationHandler ( ServerProcessReloadHandler . DEFINITION , reloadHandler , false ) ; } if ( ( serverEnvironment ) != null ) { if ( ( serverEnvironment . getLaunchType ( ) ) == ( LaunchType . STANDALONE ) ) { ServerShutdownHandler serverShutdownHandler = new ServerShutdownHandler ( processState ) ; resourceRegistration . registerOperationHandler ( ServerShutdownHandler . DEFINITION , serverShutdownHandler ) ; } resourceRegistration . registerSubModel ( ServerEnvironmentResourceDescription . of ( serverEnvironment ) ) ; } } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } @ Override public void registerChildren ( ManagementResourceRegistration resourceRegistration ) { } }

Fix:
resourceRegistration . registerOperationHandler ( WhoAmIOperation . DEFINITION , WhoAmIOperation . createOperation ( authorizer ) , true ) ;