Buggy code:
public abstract class AbstractDataSourceAdd extends AbstractAddStepHandler { protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > controllers ) throws OperationFailedException { final ModelNode address = operation . require ( OP_ADDR ) ; final String dsName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; final String jndiName = ( operation . hasDefined ( Constants . JNDINAME . getName ( ) ) ) ? operation . get ( Constants . JNDINAME . getName ( ) ) . asString ( ) : dsName ; final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; boolean enabled = false ; ModelNode node = operation . require ( Constants . DATASOURCE_DRIVER . getName ( ) ) ; AbstractDataSourceService dataSourceService = createDataSourceService ( dsName ) ; <START_BUG> final ServiceName dataSourceServiceName = SERVICE_NAME_BASE . append ( dsName ) ; <END_BUG> final ServiceBuilder < ? > dataSourceServiceBuilder = serviceTarget . addService ( dataSourceServiceName , dataSourceService ) . addDependency ( TRANSACTION_INTEGRATION_SERVICE , TransactionIntegration . class , dataSourceService . getTransactionIntegrationInjector ( ) ) . addDependency ( MANAGEMENT_REPOSISTORY_SERVICE , ManagementRepository . class , dataSourceService . getmanagementRepositoryInjector ( ) ) . addDependency ( SERVICE_NAME , SubjectFactory . class , dataSourceService . getSubjectFactoryInjector ( ) ) . addDependency ( JDBC_DRIVER_REGISTRY_SERVICE , DriverRegistry . class , dataSourceService . getDriverRegistryInjector ( ) ) . addDependency ( NamingService . SERVICE_NAME ) ; startConfigAndAddDependency ( dataSourceServiceBuilder , dataSourceService , dsName , serviceTarget , operation , verificationHandler ) ; final String driverName = node . asString ( ) ; final ServiceName driverServiceName = JBOSS . append ( "jdbc-driver" , driverName . replaceAll ( "\\." , "_" ) ) ; if ( driverServiceName != null ) { dataSourceServiceBuilder . addDependency ( driverServiceName , Driver . class , dataSourceService . getDriverInjector ( ) ) ; } dataSourceServiceBuilder . setInitialMode ( NEVER ) ; controllers . add ( dataSourceServiceBuilder . install ( ) ) ; } static String cleanupJavaContext ( String jndiName ) { } protected abstract void startConfigAndAddDependency ( ServiceBuilder < ? > dataSourceServiceBuilder , AbstractDataSourceService dataSourceService , String jndiName , ServiceTarget serviceTarget , final ModelNode operation , final ServiceVerificationHandler serviceVerificationHandler ) throws OperationFailedException { } protected abstract void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected abstract AbstractDataSourceService createDataSourceService ( final String jndiName ) throws OperationFailedException { } static void populateAddModel ( final ModelNode operation , final ModelNode modelNode , final String connectionPropertiesProp , final SimpleAttributeDefinition [ ] attributes ) throws OperationFailedException { } }

Fix:
final ServiceName dataSourceServiceName = SERVICE_NAME_BASE . append ( jndiName ) ;