Buggy code:
MessagingExtension . createParamRegistration ( inVMAcceptor ) ; AcceptorControlHandler . INSTANCE . register ( inVMAcceptor ) ; final ManagementResourceRegistration connector = rootRegistration . registerSubModel ( MessagingExtension . GENERIC_CONNECTOR , MessagingSubsystemProviders . CONNECTOR ) ; connector . registerOperationHandler ( ADD , GENERIC_ADD , CONNECTOR_ADD ) ; connector . registerOperationHandler ( REMOVE , TransportConfigOperationHandlers . REMOVE , CONNECTOR_REMOVE ) ; GENERIC_ATTR . registerAttributes ( connector ) ; MessagingExtension . createParamRegistration ( connector ) ; final ManagementResourceRegistration remoteConnector = rootRegistration . registerSubModel ( MessagingExtension . REMOTE_CONNECTOR , MessagingSubsystemProviders . REMOTE_CONNECTOR ) ; remoteConnector . registerOperationHandler ( ADD , REMOTE_ADD , REMOTE_CONNECTOR_ADD ) ; remoteConnector . registerOperationHandler ( REMOVE , TransportConfigOperationHandlers . REMOVE , CONNECTOR_REMOVE ) ; REMOTE_ATTR . registerAttributes ( remoteConnector ) ; MessagingExtension . createParamRegistration ( remoteConnector ) ; final ManagementResourceRegistration inVMConnector = rootRegistration . registerSubModel ( MessagingExtension . IN_VM_CONNECTOR , MessagingSubsystemProviders . IN_VM_CONNECTOR ) ; inVMConnector . registerOperationHandler ( ADD , IN_VM_ADD , IN_VM_CONNECTOR_ADD ) ; inVMConnector . registerOperationHandler ( REMOVE , TransportConfigOperationHandlers . REMOVE , CONNECTOR_REMOVE ) ; IN_VM_ATTR . registerAttributes ( inVMConnector ) ; MessagingExtension . createParamRegistration ( inVMConnector ) ; final ManagementResourceRegistration bridge = rootRegistration . registerSubModel ( PathElement . pathElement ( BRIDGE ) , BRIDGE_RESOURCE ) ; bridge . registerOperationHandler ( ADD , BridgeAdd . INSTANCE , BridgeAdd . INSTANCE , false ) ; bridge . registerOperationHandler ( REMOVE , BridgeRemove . INSTANCE , BridgeRemove . INSTANCE , false ) ; BridgeWriteAttributeHandler . INSTANCE . registerAttributes ( bridge ) ; BridgeControlHandler . INSTANCE . register ( bridge ) ; final ManagementResourceRegistration cluster = rootRegistration . registerSubModel ( PathElement . pathElement ( CLUSTER_CONNECTION ) , CLUSTER_CONNECTION_RESOURCE ) ; cluster . registerOperationHandler ( ADD , ClusterConnectionAdd . INSTANCE , ClusterConnectionAdd . INSTANCE , false ) ; cluster . registerOperationHandler ( REMOVE , ClusterConnectionRemove . INSTANCE , ClusterConnectionRemove . INSTANCE , false ) ; ClusterConnectionWriteAttributeHandler . INSTANCE . registerAttributes ( cluster ) ; ClusterConnectionControlHandler . INSTANCE . register ( cluster ) ; final ManagementResourceRegistration groupingHandler = rootRegistration . registerSubModel ( MessagingExtension . GROUPING_HANDLER_PATH , GROUPING_HANDLER_RESOURCE ) ; groupingHandler . registerOperationHandler ( ADD , GroupingHandlerAdd . INSTANCE , GroupingHandlerAdd . INSTANCE ) ; groupingHandler . registerOperationHandler ( REMOVE , GroupingHandlerRemove . INSTANCE , GroupingHandlerRemove . INSTANCE ) ; GroupingHandlerWriteAttributeHandler . INSTANCE . registerAttributes ( groupingHandler ) ; final ManagementResourceRegistration connectorService = rootRegistration . registerSubModel ( PathElement . pathElement ( CONNECTOR_SERVICE ) , CONNECTOR_SERVICE_RESOURCE ) ; connectorService . registerOperationHandler ( ADD , ConnectorServiceAdd . INSTANCE , ConnectorServiceAdd . INSTANCE , false ) ; connectorService . registerOperationHandler ( REMOVE , ConnectorServiceRemove . INSTANCE , ConnectorServiceRemove . INSTANCE , false ) ; for ( AttributeDefinition attributeDefinition : CommonAttributes . CONNECTOR_SERVICE_ATTRIBUTES ) { connectorService . registerReadWriteAttribute ( attributeDefinition . getName ( ) , null , ConnectorServiceWriteAttributeHandler . INSTANCE , CONFIGURATION ) ; } final ManagementResourceRegistration connectorServiceParam = connectorService . registerSubModel ( PathElement . pathElement ( CommonAttributes . PARAM ) , CONNECTOR_SERVICE_PARAM_RESOURCE ) ; connectorServiceParam . registerOperationHandler ( ADD , ConnectorServiceParamAdd . INSTANCE , ConnectorServiceParamAdd . INSTANCE , false ) ; connectorServiceParam . registerOperationHandler ( REMOVE , ConnectorServiceParamRemove . INSTANCE , ConnectorServiceParamRemove . INSTANCE , false ) ; connectorServiceParam . registerReadWriteAttribute ( VALUE . getName ( ) , null , ConnectorServiceParamWriteAttributeHandler . INSTANCE , CONFIGURATION ) ; for ( final String path : CommonAttributes . PATHS ) { ManagementResourceRegistration bindings = rootRegistration . registerSubModel ( PathElement . pathElement ( PATH , path ) , new MessagingSubsystemProviders . PathProvider ( path ) ) ; MessagingPathHandlers . register ( bindings ) ; } final ManagementResourceRegistration cfs = rootRegistration . registerSubModel ( MessagingExtension . CFS_PATH , CF ) ; cfs . registerOperationHandler ( ADD , ConnectionFactoryAdd . INSTANCE , CF_ADD , false ) ; cfs . registerOperationHandler ( REMOVE , ConnectionFactoryRemove . INSTANCE , CF_REMOVE , false ) ; ConnectionFactoryWriteAttributeHandler . INSTANCE . registerAttributes ( cfs ) ; ConnectionFactoryReadAttributeHandler . INSTANCE . registerAttributes ( cfs ) ; ConnectionFactoryAddJndiHandler . INSTANCE . registerOperation ( cfs ) ; final ManagementResourceRegistration resourceAdapters = rootRegistration . registerSubModel ( MessagingExtension . RA_PATH , RA ) ; resourceAdapters . registerOperationHandler ( ADD , PooledConnectionFactoryAdd . INSTANCE , RA_ADD , false ) ; resourceAdapters . registerOperationHandler ( REMOVE , PooledConnectionFactoryRemove . INSTANCE , RA_REMOVE ) ; PooledConnectionFactoryWriteAttributeHandler . INSTANCE . registerAttributes ( resourceAdapters ) ; final ManagementResourceRegistration queues = rootRegistration . registerSubModel ( MessagingExtension . JMS_QUEUE_PATH , JMS_QUEUE_RESOURCE ) ; queues . registerOperationHandler ( ADD , JMSQueueAdd . INSTANCE , JMSQueueAdd . INSTANCE , false ) ; queues . registerOperationHandler ( REMOVE , JMSQueueRemove . INSTANCE , JMSQueueRemove . INSTANCE , false ) ; JmsQueueConfigurationWriteHandler . INSTANCE . registerAttributes ( queues ) ; JmsQueueReadAttributeHandler . INSTANCE . registerAttributes ( queues ) ; JMSQueueAddJndiHandler . INSTANCE . registerOperation ( queues ) ; JMSQueueControlHandler . INSTANCE . registerOperations ( queues ) ; final ManagementResourceRegistration topics = rootRegistration . registerSubModel ( MessagingExtension . TOPIC_PATH , JMS_TOPIC_RESOURCE ) ; topics . registerOperationHandler ( ADD , JMSTopicAdd . INSTANCE , JMSTopicAdd . INSTANCE , false ) ; topics . registerOperationHandler ( REMOVE , JMSTopicRemove . INSTANCE , JMSTopicRemove . INSTANCE , false ) ; JMSTopicConfigurationWriteHandler . INSTANCE . registerAttributes ( topics ) ; JMSTopicReadAttributeHandler . INSTANCE . registerAttributes ( topics ) ; JMSTopicControlHandler . INSTANCE . registerOperations ( topics ) ; JMSTopicAddJndiHandler . INSTANCE . registerOperation ( topics ) ; final ManagementResourceRegistration securitySettings = rootRegistration . registerSubModel ( MessagingExtension . SECURITY_SETTING , MessagingSubsystemProviders . SECURITY_SETTING ) ; securitySettings . registerOperationHandler ( ADD , SecuritySettingAdd . INSTANCE , SecuritySettingAdd . INSTANCE ) ; securitySettings . registerOperationHandler ( REMOVE , SecuritySettingRemove . INSTANCE , SecuritySettingRemove . INSTANCE ) ; final ManagementResourceRegistration securityRole = securitySettings . registerSubModel ( MessagingExtension . SECURITY_ROLE , MessagingSubsystemProviders . SECURITY_ROLE ) ; securityRole . registerOperationHandler ( ADD , SecurityRoleAdd . INSTANCE , SecurityRoleAdd . INSTANCE ) ; <START_BUG> securityRole . registerOperationHandler ( REMOVE , SecurityRoleAdd . INSTANCE , SecurityRoleAdd . INSTANCE ) ; <END_BUG> SecurityRoleAttributeHandler . INSTANCE . registerAttributes ( securityRole ) ; } public void initializeParsers ( ExtensionParsingContext context ) { } static void createParamRegistration ( final ManagementResourceRegistration parent ) { } }

Fix:
securityRole . registerOperationHandler ( REMOVE , SecurityRoleRemove . INSTANCE , SecurityRoleRemove . INSTANCE ) ;