Buggy code:
public class ParsedRaDeploymentProcessor implements DeploymentUnitProcessor { public ParsedRaDeploymentProcessor ( ) { } public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final ConnectorXmlDescriptor connectorXmlDescriptor = phaseContext . getDeploymentUnit ( ) . getAttachment ( ATTACHMENT_KEY ) ; if ( connectorXmlDescriptor == null ) { return ; } final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final IronJacamarXmlDescriptor ironJacamarXmlDescriptor = deploymentUnit . getAttachment ( IronJacamarXmlDescriptor . ATTACHMENT_KEY ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; if ( module == null ) throw ConnectorMessages . 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 ResourceAdapterDeploymentService raDeployementService = new ResourceAdapterDeploymentService ( connectorXmlDescriptor , cmd , ijmd , module ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; <START_BUG> serviceTarget . addService ( RESOURCE_ADAPTER_SERVICE_PREFIX . append ( connectorXmlDescriptor . getDeploymentName ( ) ) , raDeployementService ) . addDependency ( IRONJACAMAR_MDR , MetadataRepository . class , raDeployementService . getMdrInjector ( ) ) . addDependency ( RA_REPOSISTORY_SERVICE , ResourceAdapterRepository . class , raDeployementService . getRaRepositoryInjector ( ) ) . addDependency ( MANAGEMENT_REPOSISTORY_SERVICE , ManagementRepository . class , raDeployementService . getManagementRepositoryInjector ( ) ) . addDependency ( RESOURCE_ADAPTER_REGISTRY_SERVICE , ResourceAdapterDeploymentRegistry . class , raDeployementService . getRegistryInjector ( ) ) . addDependency ( TRANSACTION_INTEGRATION_SERVICE , TransactionIntegration . class , raDeployementService . getTxIntegrationInjector ( ) ) . addDependency ( CONNECTOR_CONFIG_SERVICE , JcaSubsystemConfiguration . class , raDeployementService . getConfigInjector ( ) ) . addDependency ( SERVICE_NAME , SubjectFactory . class , raDeployementService . getSubjectFactoryInjector ( ) ) . addDependency ( CCM_SERVICE , CachedConnectionManager . class , raDeployementService . getCcmInjector ( ) ) . addDependency ( NamingService . SERVICE_NAME ) . setInitialMode ( ACTIVE ) . install ( ) ; <END_BUG> } catch ( Throwable t ) { throw new DeploymentUnitProcessingException ( t ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
serviceTarget . addService ( RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX . append ( connectorXmlDescriptor . getDeploymentName ( ) ) , raDeployementService ) . addDependency ( IRONJACAMAR_MDR , MetadataRepository . class , raDeployementService . getMdrInjector ( ) ) . addDependency ( RA_REPOSISTORY_SERVICE , ResourceAdapterRepository . class , raDeployementService . getRaRepositoryInjector ( ) ) . addDependency ( MANAGEMENT_REPOSISTORY_SERVICE , ManagementRepository . class , raDeployementService . getManagementRepositoryInjector ( ) ) . addDependency ( RESOURCE_ADAPTER_REGISTRY_SERVICE , ResourceAdapterDeploymentRegistry . class , raDeployementService . getRegistryInjector ( ) ) . addDependency ( TRANSACTION_INTEGRATION_SERVICE , TransactionIntegration . class , raDeployementService . getTxIntegrationInjector ( ) ) . addDependency ( CONNECTOR_CONFIG_SERVICE , JcaSubsystemConfiguration . class , raDeployementService . getConfigInjector ( ) ) . addDependency ( SERVICE_NAME , SubjectFactory . class , raDeployementService . getSubjectFactoryInjector ( ) ) . addDependency ( CCM_SERVICE , CachedConnectionManager . class , raDeployementService . getCcmInjector ( ) ) . addDependency ( NamingService . SERVICE_NAME ) . setInitialMode ( ACTIVE ) . install ( ) ;