Buggy code:
public class DeployerChainAddHandler implements OperationStepHandler , DescriptionProvider { static final String NAME = "add-deployer-chains" ; public static final DeployerChainAddHandler INSTANCE = new DeployerChainAddHandler ( ) ; static void addDeploymentProcessor ( Phase phase , int priority , DeploymentUnitProcessor processor ) { } static ModelNode OPERATION = new ModelNode ( ) ; private final EnumMap < Phase , Set < DeployerChainAddHandler . RegisteredProcessor > > deployerMap ; private DeployerChainAddHandler ( ) { } public void clearDeployerMap ( ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . addStep ( new DeployerChainAddHandler . FinalRuntimeStepHandler ( ) , RUNTIME ) ; context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } } , RUNTIME ) ; } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } @ Override public ModelNode getModelDescription ( Locale locale ) { } private class FinalRuntimeStepHandler implements OperationStepHandler { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { if ( ( deployerMap ) == null ) { throw new IllegalStateException ( "No<seq2seq4repair_space>deployers<seq2seq4repair_space>set" ) ; } final EnumMap < Phase , List < DeploymentUnitProcessor > > finalDeployers = new EnumMap < Phase , List < DeploymentUnitProcessor > > ( Phase . class ) ; final List < DeploymentUnitProcessor > processorList = new ArrayList < DeploymentUnitProcessor > ( 256 ) ; for ( Phase phase : Phase . values ( ) ) { processorList . clear ( ) ; final Set < DeployerChainAddHandler . RegisteredProcessor > processorSet = deployerMap . get ( phase ) ; for ( DeployerChainAddHandler . RegisteredProcessor processor : processorSet ) { processorList . add ( processor . getProcessor ( ) ) ; } finalDeployers . put ( phase , Arrays . asList ( processorList . toArray ( new DeploymentUnitProcessor [ processorList . size ( ) ] ) ) ) ; } final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; DeployerChainsService . addService ( context . getServiceTarget ( ) , finalDeployers , verificationHandler ) ; context . addStep ( verificationHandler , VERIFY ) ; context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { context . removeService ( JBOSS_DEPLOYMENT_CHAINS ) ; } } ) ; } } static final class RegisteredProcessor implements Comparable < DeployerChainAddHandler . RegisteredProcessor > { private final int priority ; private final DeploymentUnitProcessor processor ; RegisteredProcessor ( final int priority , final DeploymentUnitProcessor processor ) { } @ Override public int compareTo ( final DeployerChainAddHandler . RegisteredProcessor o ) { } int getPriority ( ) { } DeploymentUnitProcessor getProcessor ( ) { } } }

Fix:
if ( context . isNormalServer ( ) ) {