Buggy code:
public class PersistenceUnitDeploymentProcessor implements DeploymentUnitProcessor { private static final Logger log = Logger . getLogger ( "org.jboss.jpa" ) ; public static final String JNDI_PROPERTY = "jboss.entity.manager.factory.jndi.name" ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } @ Override public void undeploy ( DeploymentUnit context ) { } private void handleJarDeployment ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void handleWarDeployment ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void handleEarDeployment ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void addPuService ( DeploymentPhaseContext phaseContext , ResourceRoot resourceRoot , ArrayList < PersistenceUnitMetadataHolder > puList ) throws DeploymentUnitProcessingException { } private DeploymentUnit top ( DeploymentUnit deploymentUnit ) { } private String adjustJndi ( String dataSourceName ) { } private void addProviderProperties ( PersistenceUnitMetadata pu , Map properties , PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder ) throws DeploymentUnitProcessingException { } private PersistenceProviderAdaptor loadPersistenceAdapterModule ( String persistenceProviderClass , String adapterModule ) throws DeploymentUnitProcessingException { final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; PersistenceProviderAdaptor persistenceProviderAdaptor = null ; if ( adapterModule == null ) { adapterModule = Configuration . ADAPTER_MODULE_DEFAULT ; } if ( persistenceProviderClass == null ) { persistenceProviderClass = Configuration . PROVIDER_CLASS_DEFAULT ; } try { Module module = moduleLoader . loadModule ( ModuleIdentifier . fromString ( adapterModule ) ) ; final ServiceLoader < PersistenceProviderAdaptor > serviceLoader = module . loadService ( PersistenceProviderAdaptor . class ) ; if ( serviceLoader != null ) { for ( PersistenceProviderAdaptor adaptor : serviceLoader ) { if ( persistenceProviderAdaptor != null ) { throw new DeploymentUnitProcessingException ( ( "persistence<seq2seq4repair_space>provider<seq2seq4repair_space>adapter<seq2seq4repair_space>module<seq2seq4repair_space>has<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>adapters<seq2seq4repair_space>" + adapterModule ) ) ; } persistenceProviderAdaptor = adaptor ; PersistenceUnitDeploymentProcessor . log . debugf ( "loaded<seq2seq4repair_space>persistence<seq2seq4repair_space>provider<seq2seq4repair_space>adapter<seq2seq4repair_space>%s" , adapterModule ) ; } if ( persistenceProviderAdaptor != null ) { <START_BUG> persistenceProviderAdaptor . setJtaManager ( JtaManagerImpl . getInstance ( ) ) ; <END_BUG> PersistenceProviderAdapterRegistry . putPersistenceProviderAdaptor ( persistenceProviderClass , persistenceProviderAdaptor ) ; PersistenceProviderAdapterRegistry . putPersistenceProviderAdaptor ( persistenceProviderClass , adapterModule , persistenceProviderAdaptor ) ; } } } catch ( ModuleLoadException e ) { throw new DeploymentUnitProcessingException ( ( ( ( ( "persistence<seq2seq4repair_space>provider<seq2seq4repair_space>adapter<seq2seq4repair_space>module<seq2seq4repair_space>load<seq2seq4repair_space>error" + adapterModule ) + "(class<seq2seq4repair_space>" ) + persistenceProviderClass ) + ")" ) , e ) ; } return persistenceProviderAdaptor ; } private void loadPersistenceProviderModule ( PersistenceUnitMetadata pu , PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder ) throws DeploymentUnitProcessingException { } private Iterable < ServiceName > getProviderDependencies ( PersistenceUnitMetadata pu , PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder ) throws DeploymentUnitProcessingException { } static boolean isEarDeployment ( final DeploymentUnit context ) { } static boolean isWarDeployment ( final DeploymentUnit context ) { } private static class ManagedReferenceFactoryInjector implements Injector < ManagedReferenceFactory > { private volatile ManagedReference reference ; private final Injector < DataSource > dataSourceInjector ; public ManagedReferenceFactoryInjector ( Injector < DataSource > dataSourceInjector ) { } @ Override public void inject ( final ManagedReferenceFactory value ) throws InjectionException { } @ Override public void uninject ( ) { } } private void addPUServiceDependencyToComponents ( final Collection < ComponentDescription > components , final ServiceName puServiceName ) { } }

Fix:
persistenceProviderAdaptor . injectJtaManager ( JtaManagerImpl . getInstance ( ) ) ;