Buggy code:
class JcaSubsystemAdd implements ModelAddOperationHandler , BootOperationHandler { static final OperationHandler INSTANCE = new JcaSubsystemAdd ( ) ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) { final String shortRunningThreadPool = operation . get ( Constants . DEFAULT_WORKMANAGER_SHORT_RUNNING_THREAD_POOL ) . asString ( ) ; final String longRunningThreadPool = operation . get ( Constants . DEFAULT_WORKMANAGER_LONG_RUNNING_THREAD_POOL ) . asString ( ) ; final boolean beanValidationEnabled = ParamsUtils . parseBooleanParameter ( operation , Constants . BEAN_VALIDATION_ENABLED , false ) ; final boolean archiveValidationEnabled = ParamsUtils . parseBooleanParameter ( operation , Constants . ARCHIVE_VALIDATION_ENABLED , false ) ; final boolean failOnError = ParamsUtils . parseBooleanParameter ( operation , Constants . ARCHIVE_VALIDATION_FAIL_ON_ERROR , true ) ; final boolean failOnWarn = ParamsUtils . parseBooleanParameter ( operation , Constants . ARCHIVE_VALIDATION_FAIL_ON_WARN , false ) ; final boolean ccmDebug = ParamsUtils . parseBooleanParameter ( operation , Constants . CACHED_CONNECTION_MANAGER_DEBUG , false ) ; final boolean ccmError = ParamsUtils . parseBooleanParameter ( operation , Constants . CACHED_CONNECTION_MANAGER_ERROR , false ) ; final ModelNode model = context . getSubModel ( ) ; if ( shortRunningThreadPool != null ) { model . get ( Constants . DEFAULT_WORKMANAGER_SHORT_RUNNING_THREAD_POOL ) . set ( shortRunningThreadPool ) ; } if ( longRunningThreadPool != null ) { model . get ( Constants . DEFAULT_WORKMANAGER_LONG_RUNNING_THREAD_POOL ) . set ( longRunningThreadPool ) ; } if ( ParamsUtils . has ( operation , Constants . BEAN_VALIDATION_ENABLED ) ) { model . get ( Constants . BEAN_VALIDATION_ENABLED ) . set ( beanValidationEnabled ) ; } if ( ParamsUtils . has ( operation , Constants . ARCHIVE_VALIDATION_ENABLED ) ) { model . get ( Constants . ARCHIVE_VALIDATION_ENABLED ) . set ( archiveValidationEnabled ) ; } if ( ParamsUtils . has ( operation , Constants . ARCHIVE_VALIDATION_FAIL_ON_ERROR ) ) { model . get ( Constants . ARCHIVE_VALIDATION_FAIL_ON_ERROR ) . set ( failOnError ) ; } if ( ParamsUtils . has ( operation , Constants . ARCHIVE_VALIDATION_FAIL_ON_WARN ) ) { model . get ( Constants . ARCHIVE_VALIDATION_FAIL_ON_WARN ) . set ( failOnWarn ) ; } if ( ParamsUtils . has ( operation , Constants . CACHED_CONNECTION_MANAGER_DEBUG ) ) { model . get ( Constants . CACHED_CONNECTION_MANAGER_DEBUG ) . set ( ccmDebug ) ; } if ( ParamsUtils . has ( operation , Constants . CACHED_CONNECTION_MANAGER_ERROR ) ) { model . get ( Constants . CACHED_CONNECTION_MANAGER_ERROR ) . set ( ccmError ) ; } if ( context instanceof BootOperationContext ) { final BootOperationContext bootContext = BootOperationContext . class . cast ( context ) ; bootContext . addDeploymentProcessor ( PARSE , PARSE_DATA_SOURCE_DEFINITION_ANNOTATION , new DataSourceDefinitionAnnotationParser ( ) ) ; <START_BUG> bootContext . addDeploymentProcessor ( INSTALL , INSTALL_DATASOURCE_REF , new DataSourceDefinitionDeploymentDescriptorParser ( ) ) ; <END_BUG> context . getRuntimeContext ( ) . setRuntimeTask ( new RuntimeTask ( ) { @ Override public void execute ( RuntimeTaskContext context ) throws OperationFailedException { ServiceTarget serviceTarget = context . getServiceTarget ( ) ; TransactionIntegrationService tiService = new TransactionIntegrationService ( ) ; serviceTarget . addService ( TRANSACTION_INTEGRATION_SERVICE , tiService ) . addDependency ( JBOSS_TXN_TRANSACTION_MANAGER , TransactionManager . class , tiService . getTmInjector ( ) ) . addDependency ( JBOSS_TXN_SYNCHRONIZATION_REGISTRY , TransactionSynchronizationRegistry . class , tiService . getTsrInjector ( ) ) . addDependency ( JBOSS_TXN_USER_TRANSACTION_REGISTRY , UserTransactionRegistry . class , tiService . getUtrInjector ( ) ) . addDependency ( JBOSS_TXN_XA_TERMINATOR , JBossXATerminator . class , tiService . getTerminatorInjector ( ) ) . addDependency ( JBOSS_TXN_ARJUNA_RECOVERY_MANAGER , XAResourceRecoveryRegistry . class , tiService . getRrInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; CcmService ccmService = new CcmService ( ccmDebug , ccmError ) ; serviceTarget . addService ( CCM_SERVICE , ccmService ) . addDependency ( TRANSACTION_INTEGRATION_SERVICE , TransactionIntegration . class , ccmService . getTransactionIntegrationInjector ( ) ) . install ( ) ; WorkManager wm = new WorkManagerImpl ( ) ; final WorkManagerService wmService = new WorkManagerService ( wm ) ; serviceTarget . addService ( WORKMANAGER_SERVICE , wmService ) . addDependency ( EXECUTOR . append ( shortRunningThreadPool ) , Executor . class , wmService . getExecutorShortInjector ( ) ) . addDependency ( EXECUTOR . append ( longRunningThreadPool ) , Executor . class , wmService . getExecutorLongInjector ( ) ) . addDependency ( JBOSS_TXN_XA_TERMINATOR , JBossXATerminator . class , wmService . getXaTerminatorInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; CloneableBootstrapContext ctx = new BaseCloneableBootstrapContext ( ) ; final DefaultBootStrapContextService defaultBootCtxService = new DefaultBootStrapContextService ( ctx ) ; serviceTarget . addService ( DEFAULT_BOOTSTRAP_CONTEXT_SERVICE , defaultBootCtxService ) . addDependency ( WORKMANAGER_SERVICE , WorkManager . class , defaultBootCtxService . getWorkManagerValueInjector ( ) ) . addDependency ( JBOSS_TXN_XA_TERMINATOR , JBossXATerminator . class , defaultBootCtxService . getXaTerminatorInjector ( ) ) . addDependency ( JBOSS_TXN_ARJUNA_TRANSACTION_MANAGER , TransactionManagerService . class , defaultBootCtxService . getTxManagerInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; final JcaSubsystemConfiguration config = new JcaSubsystemConfiguration ( ) ; config . setArchiveValidation ( archiveValidationEnabled ) ; config . setArchiveValidationFailOnError ( failOnError ) ; config . setArchiveValidationFailOnWarn ( failOnWarn ) ; config . setBeanValidation ( false ) ; final JcaConfigService connectorConfigService = new JcaConfigService ( config ) ; serviceTarget . addService ( CONNECTOR_CONFIG_SERVICE , connectorConfigService ) . addDependency ( DEFAULT_BOOTSTRAP_CONTEXT_SERVICE , CloneableBootstrapContext . class , connectorConfigService . getDefaultBootstrapContextInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; final DriverRegistryService driverRegistryService = new DriverRegistryService ( ) ; serviceTarget . addService ( JDBC_DRIVER_REGISTRY_SERVICE , driverRegistryService ) . install ( ) ; new RaDeploymentActivator ( ) . activate ( bootContext , serviceTarget ) ; resultHandler . handleResultComplete ( ) ; } } ) ; } else { resultHandler . handleResultComplete ( ) ; } final ModelNode compensating = new ModelNode ( ) ; compensating . get ( OP_ADDR ) . set ( operation . require ( ADDRESS ) ) ; compensating . get ( OP ) . set ( "remove" ) ; return new org . jboss . as . controller . BasicOperationResult ( compensating ) ; } }

Fix:
bootContext . addDeploymentProcessor ( POST_MODULE , POST_MODULE_DATASOURCE_REF , new DataSourceDefinitionDeploymentDescriptorParser ( ) ) ;