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 ( ) ) ; 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 ) ; 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 ) ; } 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 , null ) ; <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 ) { new org . jboss . as . connector . subsystems . resourceadapters . IronJacamarRegistrator ( subRegistration ) . invoke ( ) ; 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 ) ;