Buggy code:
class SecurityRoleAdd implements OperationStepHandler , DescriptionProvider { static final SecurityRoleAdd INSTANCE = new SecurityRoleAdd ( ) ; static final AttributeDefinition SEND = new SecurityRoleAdd . RoleAttributeDefinition ( "send" ) ; static final AttributeDefinition CONSUME = new SecurityRoleAdd . RoleAttributeDefinition ( "consume" ) ; static final AttributeDefinition CREATE_DURABLE_QUEUE = new SecurityRoleAdd . RoleAttributeDefinition ( "create-durable-queue" , "createDurableQueue" ) ; static final AttributeDefinition DELETE_DURABLE_QUEUE = new SecurityRoleAdd . RoleAttributeDefinition ( "delete-durable-queue" , "deleteDurableQueue" ) ; static final AttributeDefinition CREATE_NON_DURABLE_QUEUE = new SecurityRoleAdd . RoleAttributeDefinition ( "create-non-durable-queue" , "createNonDurableQueue" ) ; static final AttributeDefinition DELETE_NON_DURABLE_QUEUE = new SecurityRoleAdd . RoleAttributeDefinition ( "delete-non-durable-queue" , "deleteNonDurableQueue" ) ; static final AttributeDefinition MANAGE = new SecurityRoleAdd . RoleAttributeDefinition ( "manage" ) ; static final AttributeDefinition [ ] ROLE_ATTRIBUTES = new AttributeDefinition [ ] { SecurityRoleAdd . SEND , SecurityRoleAdd . CONSUME , SecurityRoleAdd . CREATE_DURABLE_QUEUE , SecurityRoleAdd . DELETE_DURABLE_QUEUE , SecurityRoleAdd . CREATE_NON_DURABLE_QUEUE , SecurityRoleAdd . DELETE_NON_DURABLE_QUEUE , SecurityRoleAdd . MANAGE } ; static final Map < String , AttributeDefinition > ROLE_ATTRIBUTES_BY_XML_NAME ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final Resource resource = context . createResource ( EMPTY_ADDRESS ) ; final ModelNode subModel = resource . getModel ( ) ; for ( final AttributeDefinition attribute : SecurityRoleAdd . ROLE_ATTRIBUTES ) { attribute . validateAndSet ( operation , subModel ) ; } <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final HornetQServer server = SecurityRoleAdd . getServer ( context , operation ) ; if ( server != null ) { final String match = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; final String role = address . getLastElement ( ) . getValue ( ) ; final Set < Role > roles = server . getSecurityRepository ( ) . getMatch ( match ) ; roles . add ( SecurityRoleAdd . transform ( context , role , subModel ) ) ; server . getSecurityRepository ( ) . addMatch ( match , roles ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } @ Override public ModelNode getModelDescription ( final Locale locale ) { } static ModelNode createAddOperation ( final ModelNode address , final ModelNode subModel ) { } static Role transform ( final OperationContext context , final String name , final ModelNode node ) throws OperationFailedException { } static HornetQServer getServer ( final OperationContext context , ModelNode operation ) { } static final class RoleAttributeDefinition extends SimpleAttributeDefinition { RoleAttributeDefinition ( final String name ) { } RoleAttributeDefinition ( final String name , final String xmlName ) { } } }

Fix:
if ( context . isNormalServer ( ) ) {