Buggy code:
public class DataSourceEnable implements OperationStepHandler { static final DataSourceEnable LOCAL_INSTANCE = new DataSourceEnable ( false ) ; static final DataSourceEnable XA_INSTANCE = new DataSourceEnable ( true ) ; private final boolean xa ; public DataSourceEnable ( boolean xa ) { } public void execute ( OperationContext context , ModelNode operation ) { final ModelNode model = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ; boolean persist = operation . get ( PERSISTENT ) . asBoolean ( true ) ; if ( persist ) { model . get ( ENABLED ) . set ( true ) ; } else if ( ( model . hasDefined ( ENABLED ) ) && ( ! ( model . get ( ENABLED ) . asBoolean ( ) ) ) ) { model . get ( ENABLED ) . set ( new ModelNode ( ) ) ; } if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; final ModelNode address = operation . require ( OP_ADDR ) ; final String dsName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; final String jndiName = model . get ( Constants . JNDINAME . getName ( ) ) . asString ( ) ; final ServiceRegistry registry = context . getServiceRegistry ( true ) ; final List < ServiceName > serviceNames = registry . getServiceNames ( ) ; if ( isXa ( ) ) { final ModifiableXaDataSource dataSourceConfig ; try { dataSourceConfig = DataSourceModelNodeUtil . xaFrom ( context , model , dsName ) ; } catch ( ValidateException e ) { throw new OperationFailedException ( e , new ModelNode ( ) . set ( ConnectorMessages . MESSAGES . failedToCreate ( "XaDataSource" , operation , e . getLocalizedMessage ( ) ) ) ) ; } final ServiceName xaDataSourceConfigServiceName = SERVICE_NAME_BASE . append ( dsName ) ; final XADataSourceConfigService xaDataSourceConfigService = new XADataSourceConfigService ( dataSourceConfig ) ; final ServiceBuilder < ? > builder = serviceTarget . addService ( xaDataSourceConfigServiceName , xaDataSourceConfigService ) ; builder . addListener ( verificationHandler ) ; for ( ServiceName name : serviceNames ) { if ( xaDataSourceConfigServiceName . append ( "xa-datasource-properties" ) . isParentOf ( name ) ) { final ServiceController < ? > xaConfigProperyController = registry . getService ( name ) ; XaDataSourcePropertiesService xaPropService = ( ( XaDataSourcePropertiesService ) ( xaConfigProperyController . getService ( ) ) ) ; if ( xaConfigProperyController != null ) { if ( ! ( UP . equals ( xaConfigProperyController . getState ( ) ) ) ) { xaConfigProperyController . setMode ( ACTIVE ) ; builder . addDependency ( name , String . class , xaDataSourceConfigService . getXaDataSourcePropertyInjector ( xaPropService . getName ( ) ) ) ; } else { throw new OperationFailedException ( new ModelNode ( ) . set ( ConnectorMessages . MESSAGES . serviceAlreadyStarted ( "Data-source.xa-config-property" , name ) ) ) ; } } else { throw new OperationFailedException ( new ModelNode ( ) . set ( ConnectorMessages . MESSAGES . serviceNotAvailable ( "Data-source.xa-config-property" , name ) ) ) ; } } } builder . install ( ) ; } else { final ModifiableDataSource dataSourceConfig ; try { dataSourceConfig = DataSourceModelNodeUtil . from ( context , model , dsName ) ; } catch ( ValidateException e ) { throw new OperationFailedException ( e , new ModelNode ( ) . set ( ConnectorMessages . MESSAGES . failedToCreate ( "DataSource" , operation , e . getLocalizedMessage ( ) ) ) ) ; } final ServiceName dataSourceCongServiceName = DataSourceConfigService . SERVICE_NAME_BASE . append ( dsName ) ; final DataSourceConfigService configService = new DataSourceConfigService ( dataSourceConfig ) ; final ServiceBuilder < ? > builder = serviceTarget . addService ( dataSourceCongServiceName , configService ) ; builder . addListener ( verificationHandler ) ; for ( ServiceName name : serviceNames ) { <START_BUG> if ( dataSourceCongServiceName . append ( "connetion-properties" ) . isParentOf ( name ) ) { <END_BUG> final ServiceController < ? > dataSourceController = registry . getService ( name ) ; ConnectionPropertiesService connPropService = ( ( ConnectionPropertiesService ) ( dataSourceController . getService ( ) ) ) ; if ( dataSourceController != null ) { if ( ! ( UP . equals ( dataSourceController . getState ( ) ) ) ) { dataSourceController . setMode ( ACTIVE ) ; builder . addDependency ( name , String . class , configService . getConnectionPropertyInjector ( connPropService . getName ( ) ) ) ; } else { throw new OperationFailedException ( new ModelNode ( ) . set ( ConnectorMessages . MESSAGES . serviceAlreadyStarted ( "Data-source.connectionProperty" , name ) ) ) ; } } else { throw new OperationFailedException ( new ModelNode ( ) . set ( ConnectorMessages . MESSAGES . serviceNotAvailable ( "Data-source.connectionProperty" , name ) ) ) ; } } } builder . install ( ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; final ModelNode address = operation . require ( OP_ADDR ) ; final String dsName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; final String jndiName = model . get ( Constants . JNDINAME . getName ( ) ) . asString ( ) ; final ServiceRegistry registry = context . getServiceRegistry ( true ) ; final ServiceName dataSourceServiceName = AbstractDataSourceService . SERVICE_NAME_BASE . append ( jndiName ) ; final List < ServiceName > serviceNames = registry . getServiceNames ( ) ; final ServiceController < ? > dataSourceController = registry . getService ( dataSourceServiceName ) ;

Fix:
if ( dataSourceCongServiceName . append ( "connection-properties" ) . isParentOf ( name ) ) {