Buggy code:
public class ParsedRaDeploymentProcessor implements DeploymentUnitProcessor { public ParsedRaDeploymentProcessor ( ) { } public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final ConnectorXmlDescriptor connectorXmlDescriptor = phaseContext . getDeploymentUnit ( ) . getAttachment ( ATTACHMENT_KEY ) ; final ManagementResourceRegistration registration ; final ManagementResourceRegistration baseRegistration = phaseContext . getDeploymentUnit ( ) . getAttachment ( MUTABLE_REGISTRATION_ATTACHMENT ) ; final Resource deploymentResource = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_RESOURCE ) ; if ( connectorXmlDescriptor == null ) { return ; } final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ( deploymentUnit . getParent ( ) ) != null ) { registration = baseRegistration . getSubModel ( PathAddress . pathAddress ( PathElement . pathElement ( "subdeployment" ) ) ) ; } else { registration = baseRegistration ; } final IronJacamarXmlDescriptor ironJacamarXmlDescriptor = deploymentUnit . getAttachment ( IronJacamarXmlDescriptor . ATTACHMENT_KEY ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; if ( module == null ) throw MESSAGES . failedToGetModuleAttachment ( phaseContext . getDeploymentUnit ( ) ) ; DEPLOYMENT_CONNECTOR_LOGGER . debugf ( "ParsedRaDeploymentProcessor:<seq2seq4repair_space>Processing=%s" , deploymentUnit ) ; final ClassLoader classLoader = module . getClassLoader ( ) ; Connector cmd = ( connectorXmlDescriptor != null ) ? connectorXmlDescriptor . getConnector ( ) : null ; final IronJacamar ijmd = ( ironJacamarXmlDescriptor != null ) ? ironJacamarXmlDescriptor . getIronJacamar ( ) : null ; try { Annotations annotator = new Annotations ( ) ; Map < ResourceRoot , Index > indexes = AnnotationIndexUtils . getAnnotationIndexes ( deploymentUnit ) ; if ( ( indexes != null ) && ( ( indexes . size ( ) ) > 0 ) ) { DEPLOYMENT_CONNECTOR_LOGGER . debugf ( "ParsedRaDeploymentProcessor:<seq2seq4repair_space>Found<seq2seq4repair_space>%d<seq2seq4repair_space>indexes" , indexes . size ( ) ) ; for ( Map . Entry < ResourceRoot , Index > entry : indexes . entrySet ( ) ) { AnnotationRepository repository = new org . jboss . as . connector . annotations . repository . jandex . JandexAnnotationRepositoryImpl ( entry . getValue ( ) , classLoader ) ; cmd = annotator . merge ( cmd , repository , classLoader ) ; DEPLOYMENT_CONNECTOR_LOGGER . debugf ( "ParsedRaDeploymentProcessor:<seq2seq4repair_space>CMD=%s" , cmd ) ; } } if ( ( indexes == null ) || ( ( indexes . size ( ) ) == 0 ) ) DEPLOYMENT_CONNECTOR_LOGGER . debugf ( "ParsedRaDeploymentProcessor:<seq2seq4repair_space>Found<seq2seq4repair_space>0<seq2seq4repair_space>indexes" ) ; if ( cmd != null ) { cmd . validate ( ) ; cmd = new Merger ( ) . mergeConnectorWithCommonIronJacamar ( ijmd , cmd ) ; } final ServiceName deployerServiceName = RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX . append ( connectorXmlDescriptor . getDeploymentName ( ) ) ; <START_BUG> final ResourceAdapterDeploymentService raDeploymentService = new ResourceAdapterDeploymentService ( connectorXmlDescriptor , cmd , ijmd , module , deployerServiceName ) ; <END_BUG> final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; ServiceBuilder builder = serviceTarget . addService ( deployerServiceName , raDeploymentService ) . addDependency ( IRONJACAMAR_MDR , AS7MetadataRepository . class , raDeploymentService . getMdrInjector ( ) ) . addDependency ( RA_REPOSITORY_SERVICE , ResourceAdapterRepository . class , raDeploymentService . getRaRepositoryInjector ( ) ) . addDependency ( MANAGEMENT_REPOSITORY_SERVICE , ManagementRepository . class , raDeploymentService . getManagementRepositoryInjector ( ) ) . addDependency ( RESOURCE_ADAPTER_REGISTRY_SERVICE , ResourceAdapterDeploymentRegistry . class , raDeploymentService . getRegistryInjector ( ) ) . addDependency ( TRANSACTION_INTEGRATION_SERVICE , TransactionIntegration . class , raDeploymentService . getTxIntegrationInjector ( ) ) . addDependency ( CONNECTOR_CONFIG_SERVICE , JcaSubsystemConfiguration . class , raDeploymentService . getConfigInjector ( ) ) . addDependency ( SERVICE_NAME , SubjectFactory . class , raDeploymentService . getSubjectFactoryInjector ( ) ) . addDependency ( CCM_SERVICE , CachedConnectionManager . class , raDeploymentService . getCcmInjector ( ) ) . addDependency ( IDLE_REMOVER_SERVICE ) . addDependency ( CONNECTION_VALIDATOR_SERVICE ) . addDependency ( NamingService . SERVICE_NAME ) ; builder . addListener ( new AbstractResourceAdapterDeploymentServiceListener ( registration , deploymentUnit . getName ( ) , deploymentResource ) { @ Override protected void registerIronjacamar ( final ServiceController < ? extends Object > controller , final ManagementResourceRegistration subRegistration , final Resource subsystemResource ) { subRegistration . registerSubModel ( new IronJacamarResourceDefinition ( ) ) ; AS7MetadataRepository mdr = ( ( ResourceAdapterDeploymentService ) ( controller . getService ( ) ) ) . getMdr ( ) ; INSTANCE . execute ( subsystemResource , mdr ) ; } @ Override protected CommonDeployment getDeploymentMetadata ( final ServiceController < ? extends Object > controller ) { return ( ( ResourceAdapterDeploymentService ) ( controller . getService ( ) ) ) . getRaDeployment ( ) ; } } ) ; builder . setInitialMode ( ACTIVE ) . install ( ) ; } catch ( Throwable t ) { throw new DeploymentUnitProcessingException ( t ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final ResourceAdapterDeploymentService raDeploymentService = new ResourceAdapterDeploymentService ( connectorXmlDescriptor , cmd , ijmd , module , deployerServiceName , deploymentUnit . getServiceName ( ) ) ;