Buggy code:
public class RaXmlDeploymentProcessor implements DeploymentUnitProcessor { private final MetadataRepository mdr ; public RaXmlDeploymentProcessor ( final MetadataRepository mdr ) { } public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ConnectorXmlDescriptor connectorXmlDescriptor = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; if ( connectorXmlDescriptor == null ) { return ; } ResourceAdapters raxmls = null ; final ServiceController < ? > raService = phaseContext . getServiceRegistry ( ) . getService ( RESOURCEADAPTERS_SERVICE ) ; if ( raService != null ) raxmls = ( ( ResourceAdapters ) ( raService . getValue ( ) ) ) ; if ( raxmls == null ) return ; ConnectorLogger . ROOT_LOGGER . tracef ( "processing<seq2seq4repair_space>Raxml" ) ; Module module = deploymentUnit . getAttachment ( MODULE ) ; if ( module == null ) throw ConnectorMessages . MESSAGES . failedToGetModuleAttachment ( deploymentUnit ) ; try { final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; for ( ResourceAdapter raxml : raxmls . getResourceAdapters ( ) ) { if ( deploymentUnit . getName ( ) . equals ( raxml . getArchive ( ) ) ) { final String deployment ; if ( ( deploymentUnit . getName ( ) . lastIndexOf ( '.' ) ) == ( - 1 ) ) { deployment = deploymentUnit . getName ( ) ; } else { deployment = deploymentUnit . getName ( ) . substring ( 0 , deploymentUnit . getName ( ) . lastIndexOf ( '.' ) ) ; } String suffix = ConnectorServices . getNextValidSuffix ( connectorXmlDescriptor . getDeploymentName ( ) ) ; ResourceAdapterXmlDeploymentService service = new ResourceAdapterXmlDeploymentService ( connectorXmlDescriptor , raxml , module , deployment , suffix ) ; ServiceName serviceName = ConnectorServices . registerResourceAdapterXmlServiceNameWithSuffix ( connectorXmlDescriptor . getDeploymentName ( ) , suffix ) ; <START_BUG> serviceTarget . addService ( serviceName , service ) . addDependency ( IRONJACAMAR_MDR , MetadataRepository . class , service . getMdrInjector ( ) ) . addDependency ( RA_REPOSISTORY_SERVICE , ResourceAdapterRepository . class , service . getRaRepositoryInjector ( ) ) . addDependency ( MANAGEMENT_REPOSISTORY_SERVICE , ManagementRepository . class , service . getManagementRepositoryInjector ( ) ) . addDependency ( RESOURCE_ADAPTER_REGISTRY_SERVICE , ResourceAdapterDeploymentRegistry . class , service . getRegistryInjector ( ) ) . addDependency ( TRANSACTION_INTEGRATION_SERVICE , TransactionIntegration . class , service . getTxIntegrationInjector ( ) ) . addDependency ( CONNECTOR_CONFIG_SERVICE , JcaSubsystemConfiguration . class , service . getConfigInjector ( ) ) . addDependency ( SERVICE_NAME , SubjectFactory . class , service . getSubjectFactoryInjector ( ) ) . addDependency ( CCM_SERVICE , CachedConnectionManager . class , service . getCcmInjector ( ) ) . addDependency ( NamingService . SERVICE_NAME ) . addDependency ( RESOURCE_ADAPTER_SERVICE_PREFIX . append ( connectorXmlDescriptor . getDeploymentName ( ) ) ) . setInitialMode ( ACTIVE ) . install ( ) ; <END_BUG> } } } catch ( Throwable t ) { throw new DeploymentUnitProcessingException ( t ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

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