Buggy code:
public class HttpManagementAddHandler extends AbstractAddStepHandler { public static final String OPERATION_NAME = ModelDescriptionConstants . ADD ; private final LocalHostControllerInfoImpl hostControllerInfo ; private final HostControllerEnvironment environment ; public HttpManagementAddHandler ( final LocalHostControllerInfoImpl hostControllerInfo , final HostControllerEnvironment environment ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } @ Override protected void rollbackRuntime ( OperationContext context , ModelNode operation , ModelNode model , List < ServiceController < ? > > controllers ) { } static void populateHostControllerInfo ( final LocalHostControllerInfoImpl hostControllerInfo , final OperationContext context , final ModelNode model ) throws OperationFailedException { } public static void installHttpManagementServices ( final RunningMode runningMode , final ServiceTarget serviceTarget , final LocalHostControllerInfo hostControllerInfo , final HostControllerEnvironment environment , final ServiceVerificationHandler verificationHandler ) { String interfaceName = hostControllerInfo . getHttpManagementInterface ( ) ; int port = hostControllerInfo . getHttpManagementPort ( ) ; int securePort = hostControllerInfo . getHttpManagementSecurePort ( ) ; String securityRealm = hostControllerInfo . getHttpManagementSecurityRealm ( ) ; HostControllerLogger . AS_ROOT_LOGGER . creatingHttpManagementService ( interfaceName , port , securePort ) ; final ThreadFactory httpMgmtThreads = new JBossThreadFactory ( new ThreadGroup ( "HttpManagementService-threads" ) , Boolean . FALSE , null , "%G<seq2seq4repair_space>-<seq2seq4repair_space>%t" , null , null , AccessController . getContext ( ) ) ; ConsoleMode consoleMode = ConsoleMode . CONSOLE ; if ( runningMode == ( RunningMode . ADMIN_ONLY ) ) { consoleMode = ConsoleMode . ADMIN_ONLY ; } else if ( ! ( hostControllerInfo . isMasterDomainController ( ) ) ) { consoleMode = ConsoleMode . SLAVE_HC ; } <START_BUG> final HttpManagementService service = new HttpManagementService ( consoleMode ) ; <END_BUG> ServiceBuilder < ? > builder = serviceTarget . addService ( SERVICE_NAME , service ) . addDependency ( JBOSS_NETWORK_INTERFACE . append ( interfaceName ) , NetworkInterfaceBinding . class , service . getInterfaceInjector ( ) ) . addDependency ( DomainModelControllerService . SERVICE_NAME , ModelController . class , service . getModelControllerInjector ( ) ) . addInjection ( service . getPortInjector ( ) , port ) . addInjection ( service . getSecurePortInjector ( ) , securePort ) . addInjection ( service . getExecutorServiceInjector ( ) , Executors . newCachedThreadPool ( httpMgmtThreads ) ) ; if ( securityRealm != null ) { builder . addDependency ( BASE_SERVICE_NAME . append ( securityRealm ) , SecurityRealmService . class , service . getSecurityRealmInjector ( ) ) ; } else { HostControllerLogger . AS_ROOT_LOGGER . noSecurityRealmDefined ( ) ; } if ( verificationHandler != null ) { builder . addListener ( verificationHandler ) ; } builder . setInitialMode ( ACTIVE ) . install ( ) ; } }

Fix:
final HttpManagementService service = new HttpManagementService ( consoleMode , environment . getProductConfig ( ) . getConsoleSlot ( ) ) ;