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 ManagementResourceRegistration baseRegistration = deploymentUnit . getAttachment ( MUTABLE_REGISTRATION_ATTACHMENT ) ; final ManagementResourceRegistration registration ; final Resource deploymentResource = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_RESOURCE ) ; final ConnectorXmlDescriptor connectorXmlDescriptor = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; if ( connectorXmlDescriptor == null ) { return ; } if ( ( deploymentUnit . getParent ( ) ) != null ) { registration = baseRegistration . getSubModel ( PathAddress . pathAddress ( PathElement . pathElement ( "subdeployment" ) ) ) ; } else { registration = baseRegistration ; } ResourceAdaptersService . ModifiableResourceAdaptors raxmls = null ; final ServiceController < ? > raService = phaseContext . getServiceRegistry ( ) . getService ( RESOURCEADAPTERS_SERVICE ) ; if ( raService != null ) raxmls = ( ( ResourceAdaptersService . ModifiableResourceAdaptors ) ( raService . getValue ( ) ) ) ; ROOT_LOGGER . tracef ( "processing<seq2seq4repair_space>Raxml" ) ; Module module = deploymentUnit . getAttachment ( MODULE ) ; if ( module == null ) throw ConnectorLogger . ROOT_LOGGER . failedToGetModuleAttachment ( deploymentUnit ) ; try { final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; String deploymentUnitPrefix = "" ; if ( ( deploymentUnit . getParent ( ) ) != null ) { deploymentUnitPrefix = ( deploymentUnit . getParent ( ) . getName ( ) ) + "#" ; } final String deploymentUnitName = deploymentUnitPrefix + ( deploymentUnit . getName ( ) ) ; final String deployment ; if ( ( deploymentUnitName . lastIndexOf ( '.' ) ) == ( - 1 ) ) { deployment = deploymentUnitName ; } else { deployment = deploymentUnitName . substring ( 0 , deploymentUnitName . lastIndexOf ( '.' ) ) ; } if ( raxmls != null ) { for ( Activation raxml : raxmls . getActivations ( ) ) { String rarName = raxml . getArchive ( ) ; if ( deploymentUnitName . equals ( rarName ) ) { <START_BUG> RaServicesFactory . createDeploymentService ( registration , connectorXmlDescriptor , module , serviceTarget , deploymentUnitName , deploymentUnit . getServiceName ( ) , deploymentUnitName , raxml , deploymentResource ) ; <END_BUG> } } } ServiceName serviceName = INACTIVE_RESOURCE_ADAPTER_SERVICE . append ( deploymentUnitName ) ; InactiveResourceAdapterDeploymentService service = new InactiveResourceAdapterDeploymentService ( connectorXmlDescriptor , module , deploymentUnitName , deploymentUnitName , deploymentUnit . getServiceName ( ) , registration , serviceTarget , deploymentResource ) ; ServiceBuilder builder = serviceTarget . addService ( serviceName , service ) ; builder . setInitialMode ( ACTIVE ) . install ( ) ; } catch ( Throwable t ) { throw new DeploymentUnitProcessingException ( t ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
RaServicesFactory . createDeploymentService ( registration , connectorXmlDescriptor , module , serviceTarget , deploymentUnitName , deploymentUnit . getServiceName ( ) , deploymentUnitName , raxml , deploymentResource , false ) ;