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 ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; 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 ROOT_LOGGER . failedToGetModuleAttachment ( phaseContext . getDeploymentUnit ( ) ) ; DEPLOYMENT_CONNECTOR_LOGGER . debugf ( "ParsedRaDeploymentProcessor:<seq2seq4repair_space>Processing=%s" , deploymentUnit ) ; final ClassLoader classLoader = module . getClassLoader ( ) ; Map < ResourceRoot , Index > annotationIndexes = AnnotationIndexUtils . getAnnotationIndexes ( deploymentUnit ) ; ServiceBuilder builder = ParsedRaDeploymentProcessor . process ( connectorXmlDescriptor , ironJacamarXmlDescriptor , classLoader , serviceTarget , annotationIndexes , deploymentUnit . getServiceName ( ) ) ; if ( builder != null ) { String bootstrapCtx = null ; if ( ( ( ironJacamarXmlDescriptor != null ) && ( ( ironJacamarXmlDescriptor . getIronJacamar ( ) ) != null ) ) && ( ( ironJacamarXmlDescriptor . getIronJacamar ( ) . getBootstrapContext ( ) ) != null ) ) bootstrapCtx = ironJacamarXmlDescriptor . getIronJacamar ( ) . getBootstrapContext ( ) ; if ( bootstrapCtx == null ) bootstrapCtx = "default" ; if ( ( registration . isAllowsOverride ( ) ) && ( ( registration . getOverrideModel ( deploymentUnit . getName ( ) ) ) == null ) ) { registration . registerOverrideModel ( deploymentUnit . getName ( ) , new OverrideDescriptionProvider ( ) { @ Override public Map < String , ModelNode > getAttributeOverrideDescriptions ( Locale locale ) { return Collections . emptyMap ( ) ; } @ Override public Map < String , ModelNode > getChildTypeOverrideDescriptions ( Locale locale ) { return Collections . emptyMap ( ) ; } } ) ; } <START_BUG> builder . addListener ( new AbstractResourceAdapterDeploymentServiceListener ( registration , deploymentUnit . getName ( ) , deploymentResource , bootstrapCtx , deploymentUnit . getName ( ) , false ) { <END_BUG> @ Override protected void registerIronjacamar ( final ServiceController < ? extends Object > controller , final ManagementResourceRegistration subRegistration , final Resource subsystemResource ) { try { subRegistration . registerSubModel ( new IronJacamarResourceDefinition ( ) ) ; } catch ( IllegalArgumentException iae ) { } AS7MetadataRepository mdr = ( ( org . jboss . as . connector . services . resourceadapters . deployment . ResourceAdapterDeploymentService ) ( controller . getService ( ) ) ) . getMdr ( ) ; INSTANCE . execute ( subsystemResource , mdr ) ; } @ Override protected CommonDeployment getDeploymentMetadata ( final ServiceController < ? extends Object > controller ) { return ( ( org . jboss . as . connector . services . resourceadapters . deployment . ResourceAdapterDeploymentService ) ( controller . getService ( ) ) ) . getRaDeployment ( ) ; } } ) ; builder . setInitialMode ( ACTIVE ) . install ( ) ; } } public static ServiceBuilder process ( final ConnectorXmlDescriptor connectorXmlDescriptor , final IronJacamarXmlDescriptor ironJacamarXmlDescriptor , final ClassLoader classLoader , final ServiceTarget serviceTarget , final Map < ResourceRoot , Index > annotationIndexes , final ServiceName duServiceName ) throws DeploymentUnitProcessingException { } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
builder . addListener ( new AbstractResourceAdapterDeploymentServiceListener ( registration , deploymentUnit . getName ( ) , deploymentResource , bootstrapCtx , deploymentUnit . getName ( ) ) {