Buggy code:
public class DeploymentAddHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = ADD ; static ModelNode getOperation ( ModelNode address , ModelNode state ) { } protected final ContentRepository contentRepository ; protected final ParametersValidator validator = new ParametersValidator ( ) ; protected final ParametersValidator unmanagedContentValidator = new ParametersValidator ( ) ; protected final ParametersValidator managedContentValidator = new ParametersValidator ( ) ; protected DeploymentAddHandler ( final ContentRepository contentRepository ) { } public static DeploymentAddHandler createForStandalone ( final ContentRepository contentRepository ) { } public static DeploymentAddHandler createForDomainServer ( final ContentRepository contentRepository , final DeploymentFileRepository remoteFileRepository ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validate ( operation ) ; final ModelNode opAddr = operation . get ( OP_ADDR ) ; PathAddress address = PathAddress . pathAddress ( opAddr ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final String runtimeName = ( operation . hasDefined ( RUNTIME_NAME ) ) ? operation . get ( RUNTIME_NAME ) . asString ( ) : name ; final ModelNode content = operation . require ( CONTENT ) . clone ( ) ; final DeploymentHandlerUtil . ContentItem contentItem ; final ModelNode contentItemNode = content . require ( 0 ) ; if ( contentItemNode . hasDefined ( HASH ) ) { managedContentValidator . validate ( contentItemNode ) ; byte [ ] hash = contentItemNode . require ( HASH ) . asBytes ( ) ; contentItem = addFromHash ( hash , contentItemNode ) ; } else if ( AbstractDeploymentHandler . hasValidContentAdditionParameterDefined ( contentItemNode ) ) { contentItem = addFromContentAdditionParameter ( context , contentItemNode ) ; } else { contentItem = addUnmanaged ( contentItemNode ) ; } final Resource resource = context . createResource ( EMPTY_ADDRESS ) ; ModelNode subModel = resource . getModel ( ) ; subModel . get ( NAME ) . set ( name ) ; subModel . get ( RUNTIME_NAME ) . set ( runtimeName ) ; subModel . get ( CONTENT ) . set ( content ) ; subModel . get ( ENABLED ) . set ( ( ( operation . has ( ENABLED ) ) && ( operation . get ( ENABLED ) . asBoolean ( ) ) ) ) ; subModel . get ( PERSISTENT ) . set ( ( ( ! ( operation . hasDefined ( PERSISTENT ) ) ) || ( operation . get ( PERSISTENT ) . asBoolean ( ) ) ) ) ; <START_BUG> if ( ( subModel . get ( ENABLED ) . asBoolean ( ) ) && ( ( context . getType ( ) ) == ( Type . SERVER ) ) ) { <END_BUG> DeploymentHandlerUtil . deploy ( context , runtimeName , name , contentItem ) ; } context . completeStep ( ) ; } ContentItem addFromHash ( byte [ ] hash , ModelNode contentItemNode ) throws OperationFailedException { } ContentItem addFromContentAdditionParameter ( OperationContext context , ModelNode contentItemNode ) throws OperationFailedException { } ContentItem addUnmanaged ( ModelNode contentItemNode ) throws OperationFailedException { } private static class DomainServerDeploymentAddHandler extends DeploymentAddHandler { final DeploymentFileRepository remoteFileRepository ; DomainServerDeploymentAddHandler ( ContentRepository contentRepository , DeploymentFileRepository remoteFileRepository ) { } @ Override ContentItem addFromHash ( byte [ ] hash , ModelNode contentItemNode ) throws OperationFailedException { } @ Override ContentItem addFromContentAdditionParameter ( OperationContext context , ModelNode contentItemNode ) throws OperationFailedException { } } }

Fix:
if ( ( subModel . get ( ENABLED ) . asBoolean ( ) ) && ( context . isNormalServer ( ) ) ) {