Buggy code:
public abstract class AbstractDataSourceAdd implements ModelAddOperationHandler { public static final Logger log = Logger . getLogger ( "org.jboss.as.connector.subsystems.datasources" ) ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) throws OperationFailedException { final ModelNode subModel = context . getSubModel ( ) ; populateModel ( operation , subModel ) ; final ModelNode address = operation . require ( OP_ADDR ) ; final ModelNode compensating = Util . getResourceRemoveOperation ( address ) ; final String rawJndiName = operation . require ( Constants . JNDINAME ) . asString ( ) ; final String jndiName ; if ( ( ( ! ( rawJndiName . startsWith ( "java://" ) ) ) && ( operation . hasDefined ( Constants . USE_JAVA_CONTEXT ) ) ) && ( operation . get ( Constants . USE_JAVA_CONTEXT ) . asBoolean ( ) ) ) { jndiName = "java://" + rawJndiName ; } else { jndiName = rawJndiName ; } if ( ( context . getRuntimeContext ( ) ) != null ) { context . getRuntimeContext ( ) . setRuntimeTask ( new RuntimeTask ( ) { @ Override public void execute ( RuntimeTaskContext context ) throws OperationFailedException { final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; boolean enabled = ( ! ( operation . hasDefined ( Constants . ENABLED ) ) ) || ( operation . get ( Constants . ENABLED ) . asBoolean ( ) ) ; AbstractDataSourceService dataSourceService = createDataSourceService ( jndiName ) ; final ServiceName dataSourceServiceName = SERVICE_NAME_BASE . append ( jndiName ) ; 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 , jndiName , serviceTarget , operation ) ; ModelNode node = operation . require ( Constants . DATASOURCE_DRIVER ) ; final String driverName = node . asString ( ) ; <START_BUG> final ServiceName driverServiceName = JBOSS . append ( "jdbc-driver" , driverName . replaceAll ( "." , "_" ) ) ; <END_BUG> if ( driverServiceName != null ) { dataSourceServiceBuilder . addDependency ( driverServiceName , Driver . class , dataSourceService . getDriverInjector ( ) ) ; } final DataSourceReferenceFactoryService referenceFactoryService = new DataSourceReferenceFactoryService ( ) ; final ServiceName referenceFactoryServiceName = DataSourceReferenceFactoryService . SERVICE_NAME_BASE . append ( jndiName ) ; final ServiceBuilder < ? > referenceBuilder = serviceTarget . addService ( referenceFactoryServiceName , referenceFactoryService ) . addDependency ( dataSourceServiceName , DataSource . class , referenceFactoryService . getDataSourceInjector ( ) ) ; String bindName = jndiName ; if ( jndiName . startsWith ( "java://" ) ) { bindName = jndiName . substring ( 6 ) ; } final BinderService binderService = new BinderService ( bindName ) ; final ServiceName binderServiceName = JAVA_CONTEXT_SERVICE_NAME . append ( jndiName ) ; final ServiceBuilder < ? > binderBuilder = serviceTarget . addService ( binderServiceName , binderService ) . addDependency ( referenceFactoryServiceName , ManagedReferenceFactory . class , binderService . getManagedObjectInjector ( ) ) . addDependency ( JAVA_CONTEXT_SERVICE_NAME , NamingStore . class , binderService . getNamingStoreInjector ( ) ) . addListener ( new org . jboss . msc . service . AbstractServiceListener < Object > ( ) { @ Override public void serviceStarted ( ServiceController < ? > controller ) { AbstractDataSourceAdd . log . infof ( "Bound<seq2seq4repair_space>data<seq2seq4repair_space>source<seq2seq4repair_space>[%s]" , jndiName ) ; } @ Override public void serviceStopped ( ServiceController < ? > serviceController ) { AbstractDataSourceAdd . log . infof ( "Unbound<seq2seq4repair_space>data<seq2seq4repair_space>source<seq2seq4repair_space>[%s]" , jndiName ) ; } @ Override public void serviceRemoved ( ServiceController < ? > serviceController ) { AbstractDataSourceAdd . log . debugf ( "Removed<seq2seq4repair_space>JDBC<seq2seq4repair_space>Data-source<seq2seq4repair_space>[%s]" , jndiName ) ; serviceController . removeListener ( this ) ; } } ) ; if ( enabled ) { dataSourceServiceBuilder . setInitialMode ( ACTIVE ) . install ( ) ; referenceBuilder . setInitialMode ( ACTIVE ) . install ( ) ; binderBuilder . setInitialMode ( ACTIVE ) . install ( ) ; } else { dataSourceServiceBuilder . setInitialMode ( NEVER ) . install ( ) ; referenceBuilder . setInitialMode ( NEVER ) . install ( ) ; binderBuilder . setInitialMode ( NEVER ) . install ( ) ; } resultHandler . handleResultComplete ( ) ; } } ) ; } else { resultHandler . handleResultComplete ( ) ; } return new org . jboss . as . controller . BasicOperationResult ( compensating ) ; } protected abstract void startConfigAndAddDependency ( ServiceBuilder < ? > dataSourceServiceBuilder , AbstractDataSourceService dataSourceService , String jndiName , ServiceTarget serviceTarget , final ModelNode operation ) throws OperationFailedException { } protected abstract void populateModel ( final ModelNode operation , final ModelNode model ) { } protected abstract AbstractDataSourceService createDataSourceService ( final String jndiName ) throws OperationFailedException { } static void populateAddModel ( final ModelNode existingModel , final ModelNode newModel , final String connectionPropertiesProp , final AttributeDefinition [ ] attributes ) { } }

Fix:
final ServiceName driverServiceName = JBOSS . append ( "jdbc-driver" , driverName . replaceAll ( "\\." , "_" ) ) ;