Buggy code:
public abstract class PoolOperations implements OperationStepHandler { private final PoolOperations . PoolMatcher matcher ; protected PoolOperations ( PoolOperations . PoolMatcher matcher ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String jndiName ; ModelNode model ; if ( ( ! ( address . getElement ( 0 ) . getKey ( ) . equals ( DEPLOYMENT ) ) ) && ( ( model = context . readResource ( EMPTY_ADDRESS , false ) . getModel ( ) ) . isDefined ( ) ) ) { jndiName = Util . getJndiName ( model ) ; } else { jndiName = address . getLastElement ( ) . getValue ( ) ; } final Object [ ] parameters = getParameters ( context , operation ) ; if ( context . isNormalServer ( ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceController < ? > managementRepoService = context . getServiceRegistry ( false ) . getService ( MANAGEMENT_REPOSITORY_SERVICE ) ; if ( managementRepoService != null ) { ModelNode operationResult = null ; try { final ManagementRepository repository = ( ( ManagementRepository ) ( managementRepoService . getValue ( ) ) ) ; final List < Pool > pools = matcher . match ( jndiName , repository ) ; if ( pools . isEmpty ( ) ) { throw ROOT_LOGGER . failedToMatchPool ( jndiName ) ; } for ( Pool pool : pools ) { operationResult = invokeCommandOn ( pool , parameters ) ; } } catch ( Exception e ) { <START_BUG> throw new OperationFailedException ( new ModelNode ( ) . set ( ROOT_LOGGER . failedToInvokeOperation ( e . getLocalizedMessage ( ) ) ) ) ; <END_BUG> } if ( operationResult != null ) { context . getResult ( ) . set ( operationResult ) ; } } context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } } , RUNTIME ) ; } context . stepCompleted ( ) ; } protected abstract ModelNode invokeCommandOn ( Pool pool , Object ... parameters ) throws Exception { } protected abstract Object [ ] getParameters ( OperationContext context , ModelNode operation ) { } public static class FlushIdleConnectionInPool extends PoolOperations { public static final PoolOperations . FlushIdleConnectionInPool DS_INSTANCE = new PoolOperations . FlushIdleConnectionInPool ( new PoolOperations . DsPoolMatcher ( ) ) ; public static final PoolOperations . FlushIdleConnectionInPool RA_INSTANCE = new PoolOperations . FlushIdleConnectionInPool ( new PoolOperations . RaPoolMatcher ( ) ) ; protected FlushIdleConnectionInPool ( PoolOperations . PoolMatcher matcher ) { } @ Override protected ModelNode invokeCommandOn ( Pool pool , Object ... parameters ) { } @ Override protected Object [ ] getParameters ( OperationContext context , ModelNode operation ) { } } public static class DumpQueuedThreadInPool extends PoolOperations { public static final PoolOperations . DumpQueuedThreadInPool DS_INSTANCE = new PoolOperations . DumpQueuedThreadInPool ( new PoolOperations . DsPoolMatcher ( ) ) ; public static final PoolOperations . DumpQueuedThreadInPool RA_INSTANCE = new PoolOperations . DumpQueuedThreadInPool ( new PoolOperations . RaPoolMatcher ( ) ) ; protected DumpQueuedThreadInPool ( PoolOperations . PoolMatcher matcher ) { } @ Override protected ModelNode invokeCommandOn ( Pool pool , Object ... parameters ) { } @ Override protected Object [ ] getParameters ( OperationContext context , ModelNode operation ) { } } public static class FlushAllConnectionInPool extends PoolOperations { public static final PoolOperations . FlushAllConnectionInPool DS_INSTANCE = new PoolOperations . FlushAllConnectionInPool ( new PoolOperations . DsPoolMatcher ( ) ) ; public static final PoolOperations . FlushAllConnectionInPool RA_INSTANCE = new PoolOperations . FlushAllConnectionInPool ( new PoolOperations . RaPoolMatcher ( ) ) ; protected FlushAllConnectionInPool ( PoolOperations . PoolMatcher matcher ) { } @ Override protected ModelNode invokeCommandOn ( Pool pool , Object ... parameters ) { } @ Override protected Object [ ] getParameters ( OperationContext context , ModelNode operation ) { } } public static class FlushInvalidConnectionInPool extends PoolOperations { public static final PoolOperations . FlushInvalidConnectionInPool DS_INSTANCE = new PoolOperations . FlushInvalidConnectionInPool ( new PoolOperations . DsPoolMatcher ( ) ) ; public static final PoolOperations . FlushInvalidConnectionInPool RA_INSTANCE = new PoolOperations . FlushInvalidConnectionInPool ( new PoolOperations . RaPoolMatcher ( ) ) ; protected FlushInvalidConnectionInPool ( PoolOperations . PoolMatcher matcher ) { } @ Override protected ModelNode invokeCommandOn ( Pool pool , Object ... parameters ) { } @ Override protected Object [ ] getParameters ( OperationContext context , ModelNode operation ) { } } public static class FlushGracefullyConnectionInPool extends PoolOperations { public static final PoolOperations . FlushGracefullyConnectionInPool DS_INSTANCE = new PoolOperations . FlushGracefullyConnectionInPool ( new PoolOperations . DsPoolMatcher ( ) ) ; public static final PoolOperations . FlushGracefullyConnectionInPool RA_INSTANCE = new PoolOperations . FlushGracefullyConnectionInPool ( new PoolOperations . RaPoolMatcher ( ) ) ; protected FlushGracefullyConnectionInPool ( PoolOperations . PoolMatcher matcher ) { } @ Override protected ModelNode invokeCommandOn ( Pool pool , Object ... parameters ) { } @ Override protected Object [ ] getParameters ( OperationContext context , ModelNode operation ) { } } public static class TestConnectionInPool extends PoolOperations { public static final PoolOperations . TestConnectionInPool DS_INSTANCE = new PoolOperations . TestConnectionInPool ( new PoolOperations . DsPoolMatcher ( ) ) ; public static final PoolOperations . TestConnectionInPool RA_INSTANCE = new PoolOperations . TestConnectionInPool ( new PoolOperations . RaPoolMatcher ( ) ) ; protected TestConnectionInPool ( PoolOperations . PoolMatcher matcher ) { } @ Override protected ModelNode invokeCommandOn ( Pool pool , Object ... parameters ) throws Exception { } @ Override protected Object [ ] getParameters ( OperationContext context , ModelNode operation ) { } } private interface PoolMatcher { List < Pool > match ( String jndiName , ManagementRepository repository ) { } } private static class DsPoolMatcher implements PoolOperations . PoolMatcher { public List < Pool > match ( String jndiName , ManagementRepository repository ) { } } private static class RaPoolMatcher implements PoolOperations . PoolMatcher { public List < Pool > match ( String jndiName , ManagementRepository repository ) { }

Fix:
throw new OperationFailedException ( ROOT_LOGGER . failedToInvokeOperation ( e . getLocalizedMessage ( ) ) ) ;