Buggy code:
public class JdbcDriverAdd implements ModelAddOperationHandler { static final JdbcDriverAdd INSTANCE = new JdbcDriverAdd ( ) ; 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 address = operation . require ( OP_ADDR ) ; final PathAddress pathAddress = PathAddress . pathAddress ( address ) ; final String driverName = operation . require ( Constants . DRIVER_NAME ) . asString ( ) ; final String moduleName = operation . require ( Constants . DRIVER_MODULE_NAME ) . asString ( ) ; final Integer majorVersion = ( operation . hasDefined ( Constants . DRIVER_MAJOR_VERSION ) ) ? operation . get ( Constants . DRIVER_MAJOR_VERSION ) . asInt ( ) : null ; final Integer minorVersion = ( operation . hasDefined ( Constants . DRIVER_MINOR_VERSION ) ) ? operation . get ( Constants . DRIVER_MINOR_VERSION ) . asInt ( ) : null ; final String driverClassName = ( operation . hasDefined ( Constants . DRIVER_CLASS_NAME ) ) ? operation . get ( Constants . DRIVER_CLASS_NAME ) . asString ( ) : null ; final String xaDataSourceClassName = ( operation . hasDefined ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME ) ) ? operation . get ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME ) . asString ( ) : null ; final ModelNode model = context . getSubModel ( ) ; model . get ( Constants . DRIVER_NAME ) . set ( driverName ) ; model . get ( Constants . DRIVER_MODULE_NAME ) . set ( moduleName ) ; if ( majorVersion != null ) model . get ( Constants . DRIVER_MAJOR_VERSION ) . set ( majorVersion ) ; if ( minorVersion != null ) model . get ( Constants . DRIVER_MINOR_VERSION ) . set ( minorVersion ) ; if ( driverClassName != null ) model . get ( Constants . DRIVER_CLASS_NAME ) . set ( driverClassName ) ; if ( xaDataSourceClassName != null ) model . get ( Constants . DRIVER_XA_DATASOURCE_CLASS_NAME ) . set ( xaDataSourceClassName ) ; final ModelNode compensating = Util . getResourceRemoveOperation ( address ) ; if ( ( context . getRuntimeContext ( ) ) != null ) { context . getRuntimeContext ( ) . setRuntimeTask ( new RuntimeTask ( ) { @ Override public void execute ( RuntimeTaskContext context ) throws OperationFailedException { final ServiceTarget target = context . getServiceTarget ( ) ; final ModuleIdentifier moduleId ; final Module module ; try { moduleId = ModuleIdentifier . create ( moduleName ) ; module = Module . getCallerModuleLoader ( ) . loadModule ( moduleId ) ; } catch ( ModuleLoadException e ) { throw new OperationFailedException ( e , new ModelNode ( ) . set ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>module<seq2seq4repair_space>for<seq2seq4repair_space>driver<seq2seq4repair_space>[" + moduleName ) + "]" ) ) ) ; } if ( driverClassName == null ) { final ServiceLoader < Driver > serviceLoader = module . loadService ( Driver . class ) ; if ( serviceLoader != null ) for ( Driver driver : serviceLoader ) { startDriverServices ( target , moduleId , driver ) ; } } else { try { final Class < ? extends Driver > driverClass = module . getClassLoader ( ) . loadClass ( driverClassName ) . asSubclass ( Driver . class ) ; final Constructor < ? extends Driver > constructor = driverClass . getConstructor ( ) ; final Driver driver = constructor . newInstance ( ) ; startDriverServices ( target , moduleId , driver ) ; } catch ( Exception e ) { JdbcDriverAdd . log . warnf ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>instantiate<seq2seq4repair_space>driver<seq2seq4repair_space>class<seq2seq4repair_space>\"%s\":<seq2seq4repair_space>%s" , driverClassName , e ) ; } } resultHandler . handleResultComplete ( ) ; } private void startDriverServices ( final ServiceTarget target , final ModuleIdentifier moduleId , Driver driver ) throws IllegalStateException { final int majorVer = driver . getMajorVersion ( ) ; final int minorVer = driver . getMinorVersion ( ) ; if ( ( ( majorVersion != null ) && ( ( majorVersion . intValue ( ) ) != majorVer ) ) || ( ( minorVersion != null ) && ( ( minorVersion . intValue ( ) ) != minorVer ) ) ) { throw new IllegalStateException ( "Specified<seq2seq4repair_space>driver<seq2seq4repair_space>version<seq2seq4repair_space>doesn't<seq2seq4repair_space>match<seq2seq4repair_space>with<seq2seq4repair_space>actual<seq2seq4repair_space>driver<seq2seq4repair_space>version" ) ; } final boolean compliant = driver . jdbcCompliant ( ) ; if ( compliant ) { JdbcDriverAdd . log . infof ( "Deploying<seq2seq4repair_space>JDBC-compliant<seq2seq4repair_space>driver<seq2seq4repair_space>%s<seq2seq4repair_space>(version<seq2seq4repair_space>%d.%d)" , driver . getClass ( ) , Integer . valueOf ( majorVer ) , Integer . valueOf ( minorVer ) ) ; } else { JdbcDriverAdd . log . infof ( "Deploying<seq2seq4repair_space>non-JDBC-compliant<seq2seq4repair_space>driver<seq2seq4repair_space>%s<seq2seq4repair_space>(version<seq2seq4repair_space>%d.%d)" , driver . getClass ( ) , Integer . valueOf ( majorVer ) , Integer . valueOf ( minorVer ) ) ; } InstalledDriver driverMetadata = new InstalledDriver ( driverName , moduleId , driver . getClass ( ) . getName ( ) , xaDataSourceClassName , majorVer , minorVer , compliant ) ; DriverService driverService = new DriverService ( driverMetadata , driver ) ; <START_BUG> target . addService ( JBOSS . append ( "jdbc-driver" , driverName . replaceAll ( "." , "_" ) ) , driverService ) . addDependency ( JDBC_DRIVER_REGISTRY_SERVICE , DriverRegistry . class , driverService . getDriverRegistryServiceInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; <END_BUG> } } ) ; } else { resultHandler . handleResultComplete ( ) ; } return new org . jboss . as . controller . BasicOperationResult ( compensating ) ; } }

Fix:
target . addService ( JBOSS . append ( "jdbc-driver" , driverName . replaceAll ( "\\." , "_" ) ) , driverService ) . addDependency ( JDBC_DRIVER_REGISTRY_SERVICE , DriverRegistry . class , driverService . getDriverRegistryServiceInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ;