Buggy code:
public class RemoteDomainControllerAddHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "write-remote-domain-controller" ; public static final SimpleAttributeDefinition PORT = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( org . jboss . as . controller . descriptions . ModelDescriptionConstants . PORT , org . jboss . dmr . ModelType . INT , false ) . setAllowExpression ( true ) . setValidator ( new IntRangeValidator ( 1 , 65535 , false , true ) ) . setFlags ( RESTART_JVM ) . build ( ) ; public static final SimpleAttributeDefinition HOST = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( org . jboss . as . controller . descriptions . ModelDescriptionConstants . HOST , org . jboss . dmr . ModelType . STRING , false ) . setAllowExpression ( true ) . setValidator ( new StringLengthValidator ( 1 , Integer . MAX_VALUE , false , true ) ) . setFlags ( RESTART_JVM ) . build ( ) ; private final ManagementResourceRegistration rootRegistration ; private final HostControllerConfigurationPersister overallConfigPersister ; private final FileRepository fileRepository ; private final LocalHostControllerInfoImpl hostControllerInfo ; public static RemoteDomainControllerAddHandler getInstance ( final ManagementResourceRegistration rootRegistration , final LocalHostControllerInfoImpl hostControllerInfo , final HostControllerConfigurationPersister overallConfigPersister , final FileRepository fileRepository ) { } RemoteDomainControllerAddHandler ( final ManagementResourceRegistration rootRegistration , final LocalHostControllerInfoImpl hostControllerInfo , final HostControllerConfigurationPersister overallConfigPersister , final FileRepository fileRepository ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final Resource resource = context . readResourceForUpdate ( EMPTY_ADDRESS ) ; final ModelNode model = resource . getModel ( ) ; ModelNode dc = model . get ( DOMAIN_CONTROLLER ) ; ModelNode remoteDC = dc . get ( REMOTE ) ; RemoteDomainControllerAddHandler . PORT . validateAndSet ( operation , remoteDC ) ; RemoteDomainControllerAddHandler . HOST . validateAndSet ( operation , remoteDC ) ; if ( operation . has ( SECURITY_REALM ) ) { ModelNode securityRealm = operation . require ( SECURITY_REALM ) ; dc . get ( REMOTE , SECURITY_REALM ) . set ( securityRealm ) ; hostControllerInfo . setRemoteDomainControllerSecurityRealm ( securityRealm . resolve ( ) . asString ( ) ) ; } if ( dc . has ( LOCAL ) ) { dc . remove ( LOCAL ) ; } hostControllerInfo . setMasterDomainController ( false ) ; hostControllerInfo . setRemoteDomainControllerHost ( RemoteDomainControllerAddHandler . HOST . resolveModelAttribute ( context , remoteDC ) . asString ( ) ) ; hostControllerInfo . setRemoteDomainControllerPort ( RemoteDomainControllerAddHandler . PORT . resolveModelAttribute ( context , remoteDC ) . asInt ( ) ) ; overallConfigPersister . initializeDomainConfigurationPersister ( true ) ; <START_BUG> DomainModelUtil . initializeSlaveDomainRegistry ( rootRegistration , overallConfigPersister . getDomainPersister ( ) , fileRepository ) ; <END_BUG> context . completeStep ( ) ; } @ Override public ModelNode getModelDescription ( final Locale locale ) { } }

Fix:
DomainModelUtil . initializeSlaveDomainRegistry ( rootRegistration , overallConfigPersister . getDomainPersister ( ) , fileRepository , hostControllerInfo ) ;