Buggy code:
public class ServerToHostOperationHandlerFactoryService implements ManagementChannelInitialization , Service < ManagementChannelInitialization > { private static final Logger log = Logger . getLogger ( "org.jboss.as.host.controller.mgmt" ) ; public static final ServiceName SERVICE_NAME = JBOSS . append ( "management" , "server" , "to" , "host" , "controller" ) ; private final ExecutorService executorService ; private final InjectedValue < ManagedServerLifecycleCallback > callback = new InjectedValue < ManagedServerLifecycleCallback > ( ) ; private ServerToHostOperationHandlerFactoryService ( final ExecutorService executorService ) { } public static void install ( final ServiceTarget serviceTarget , final ServiceName serverInventoryName , final ExecutorService executorService ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public ManagementChannelInitialization getValue ( ) throws IllegalArgumentException , IllegalStateException { } @ Override public Key initialize ( final ManagementChannel channel ) { } private class InitialMessageHandler extends ManagementChannelReceiver { private final ExecutorService executorService ; private InitialMessageHandler ( ExecutorService executorService ) { } @ Override public void handleMessage ( final Channel channel , final DataInput input , final ManagementProtocolHeader header ) throws IOException { } public void handleMessage ( final Channel channel , final DataInput input , final ManagementRequestHeader header ) throws IOException { final byte type = header . getOperationId ( ) ; if ( type == ( DomainServerProtocol . REGISTER_REQUEST ) ) { expectHeader ( input , PARAM_SERVER_NAME ) ; final String serverName = input . readUTF ( ) ; ServerToHostOperationHandlerFactoryService . log . infof ( "Server<seq2seq4repair_space>[%s]<seq2seq4repair_space>registered<seq2seq4repair_space>using<seq2seq4repair_space>connection<seq2seq4repair_space>[%s]" , serverName , channel ) ; executorService . execute ( new Runnable ( ) { @ Override public void run ( ) { <START_BUG> final ManagementChannel mgmtChannel = new ManagementChannel ( serverName , channel ) ; <END_BUG> ServerToHostOperationHandlerFactoryService . this . callback . getValue ( ) . serverRegistered ( serverName , mgmtChannel , new ManagedServerLifecycleCallback . ProxyCreatedCallback ( ) { @ Override public void proxyOperationHandlerCreated ( final ManagementMessageHandler handler ) { channel . addCloseHandler ( new org . jboss . remoting3 . CloseHandler < Channel > ( ) { @ Override public void handleClose ( Channel closed , IOException exception ) { handler . shutdownNow ( ) ; } } ) ; final Channel . Receiver receiver = ManagementChannelReceiver . createDelegating ( handler ) ; mgmtChannel . receiveMessage ( receiver ) ; ServerToHostOperationHandlerFactoryService . safeWriteResponse ( channel , header , null ) ; } } ) ; } } ) ; } else { ServerToHostOperationHandlerFactoryService . safeWriteResponse ( channel , header , new IOException ( ( "unrecognized<seq2seq4repair_space>type<seq2seq4repair_space>" + type ) ) ) ; channel . close ( ) ; } } @ Override protected Receiver next ( ) { } } protected static void safeWriteResponse ( final Channel channel , final ManagementProtocolHeader header , final Exception error ) { } protected static void writeResponse ( final Channel channel , final ManagementRequestHeader header , final Exception error ) throws IOException { } protected static void writeHeader ( final ManagementProtocolHeader header , final OutputStream os ) throws IOException { } }

Fix:
final Channel mgmtChannel = channel ;