Buggy code:
private static final String INTEGER_TYPE = "java.lang.Integer" ; private static final String SESSION_DEFAULT_TYPE = "SessionDefaultType" ; private static final String TRY_LOCK = "UseTryLock" ; private static final String JMS_MESSAGE_LISTENER = "javax.jms.MessageListener" ; private static final Collection < String > JMS_ACTIVATION_CONFIG_PROPERTIES = new HashSet < String > ( ) ; private Injector < Object > transactionManager = new org . jboss . msc . value . InjectedValue < Object > ( ) ; private List < String > connectors ; private List < PooledConnectionFactoryConfigProperties > adapterParams ; private String name ; private Map < String , SocketBinding > socketBindings = new HashMap < String , SocketBinding > ( ) ; private org . jboss . msc . value . InjectedValue < HornetQServer > hornetQService = new org . jboss . msc . value . InjectedValue < HornetQServer > ( ) ; private String jndiName ; private String txSupport ; public PooledConnectionFactoryService ( String name , List < String > connectors , List < PooledConnectionFactoryConfigProperties > adapterParams , String jndiName , String txSupport ) { } public Void getValue ( ) throws IllegalArgumentException , IllegalStateException { } public void start ( StartContext context ) throws StartException { } private void createService ( ServiceTarget serviceTarget , ServiceContainer container ) throws Exception { InputStream is = null ; InputStream isIj = null ; List < ConfigProperty16 > properties = new ArrayList < ConfigProperty16 > ( ) ; try { StringBuilder connectorClassname = new StringBuilder ( ) ; StringBuilder connectorParams = new StringBuilder ( ) ; for ( String connector : connectors ) { TransportConfiguration tc = hornetQService . getValue ( ) . getConfiguration ( ) . getConnectorConfigurations ( ) . get ( connector ) ; if ( tc == null ) { throw MessagingMessages . MESSAGES . connectorNotDefined ( connector ) ; } if ( ( connectorClassname . length ( ) ) > 0 ) { connectorClassname . append ( "," ) ; connectorParams . append ( "," ) ; } connectorClassname . append ( tc . getFactoryClassName ( ) ) ; Map < String , Object > params = tc . getParams ( ) ; boolean multiple = false ; for ( Map . Entry < String , Object > entry : params . entrySet ( ) ) { if ( multiple ) { connectorParams . append ( ";" ) ; } connectorParams . append ( entry . getKey ( ) ) . append ( "=" ) . append ( entry . getValue ( ) ) ; multiple = true ; } } if ( ( connectorClassname . length ( ) ) > 0 ) { properties . add ( PooledConnectionFactoryService . simpleProperty ( PooledConnectionFactoryService . CONNECTOR_CLASSNAME , PooledConnectionFactoryService . STRING_TYPE , connectorClassname . toString ( ) ) ) ; } if ( ( connectorParams . length ( ) ) > 0 ) { properties . add ( PooledConnectionFactoryService . simpleProperty ( PooledConnectionFactoryService . CONNECTION_PARAMETERS , PooledConnectionFactoryService . STRING_TYPE , connectorParams . toString ( ) ) ) ; } for ( PooledConnectionFactoryConfigProperties adapterParam : adapterParams ) { properties . add ( PooledConnectionFactoryService . simpleProperty ( adapterParam . getName ( ) , adapterParam . getType ( ) , adapterParam . getValue ( ) ) ) ; } TransactionManagerLocator . container = container ; properties . add ( PooledConnectionFactoryService . simpleProperty ( "TransactionManagerLocatorClass" , PooledConnectionFactoryService . STRING_TYPE , TransactionManagerLocator . class . getName ( ) ) ) ; properties . add ( PooledConnectionFactoryService . simpleProperty ( "TransactionManagerLocatorMethod" , PooledConnectionFactoryService . STRING_TYPE , "getTransactionManager" ) ) ; OutboundResourceAdapter outbound = PooledConnectionFactoryService . createOutbound ( ) ; InboundResourceAdapter inbound = createInbound ( ) ; ResourceAdapter1516 ra = createResourceAdapter ( properties , outbound , inbound ) ; Connector16 cmd = PooledConnectionFactoryService . createConnector ( ra ) ; CommonConnDef common = PooledConnectionFactoryService . createConnDef ( jndiName ) ; IronJacamar ijmd = PooledConnectionFactoryService . createIron ( common , txSupport ) ; ResourceAdapterActivatorService activator = new ResourceAdapterActivatorService ( cmd , ijmd , PooledConnectionFactoryService . class . getClassLoader ( ) , name ) ; <START_BUG> serviceTarget . addService ( RESOURCE_ADAPTER_ACTIVATOR_SERVICE , activator ) . addDependency ( IRONJACAMAR_MDR , MetadataRepository . class , activator . getMdrInjector ( ) ) . addDependency ( RA_REPOSISTORY_SERVICE , ResourceAdapterRepository . class , activator . getRaRepositoryInjector ( ) ) . addDependency ( MANAGEMENT_REPOSISTORY_SERVICE , ManagementRepository . class , activator . getManagementRepositoryInjector ( ) ) . addDependency ( RESOURCE_ADAPTER_REGISTRY_SERVICE , ResourceAdapterDeploymentRegistry . class , activator . getRegistryInjector ( ) ) . addDependency ( TRANSACTION_INTEGRATION_SERVICE , TransactionIntegration . class , activator . getTxIntegrationInjector ( ) ) . addDependency ( CONNECTOR_CONFIG_SERVICE , JcaSubsystemConfiguration . class , activator . getConfigInjector ( ) ) . addDependency ( SERVICE_NAME , SubjectFactory . class , activator . getSubjectFactoryInjector ( ) ) . addDependency ( CCM_SERVICE , CachedConnectionManager . class , activator . getCcmInjector ( ) ) . addDependency ( NamingService . SERVICE_NAME ) . addDependency ( JBOSS_TXN_TRANSACTION_MANAGER ) . setInitialMode ( ACTIVE ) . install ( ) ; <END_BUG> serviceTarget . addService ( RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX . append ( name ) , NULL ) . install ( ) ; } finally { if ( is != null ) is . close ( ) ; if ( isIj != null ) isIj . close ( ) ; } } private static IronJacamarImpl createIron ( CommonConnDef common , String txSupport ) { } private static CommonConnDef createConnDef ( String jndiName ) throws ValidateException { } private static Connector16Impl createConnector ( ResourceAdapter1516 ra ) { } private ResourceAdapter1516Impl createResourceAdapter ( List < ConfigProperty16 > properties , OutboundResourceAdapter outbound , InboundResourceAdapter inbound ) { } private InboundResourceAdapter createInbound ( ) { } private static OutboundResourceAdapter createOutbound ( ) { } private static XsdString str ( String str ) { } private static ConfigProperty16 simpleProperty ( String name , String type , String value ) { } public void stop ( StopContext context ) { } public Injector < Object > getTransactionManager ( ) { } Injector < SocketBinding > getSocketBindingInjector ( String name ) { } public Injector < HornetQServer > getHornetQService ( ) { } }

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