Buggy code:
public class PersistenceProviderProcessor implements DeploymentUnitProcessor { private static final Logger log = Logger . getLogger ( "org.jboss.as.jpa" ) ; public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; final ServicesAttachment servicesAttachment = deploymentUnit . getAttachment ( SERVICES ) ; if ( ( module != null ) && ( servicesAttachment != null ) ) { final ModuleClassLoader classLoader = module . getClassLoader ( ) ; PersistenceProvider provider = null ; final List < String > providerNames = servicesAttachment . getServiceImplementations ( PersistenceProvider . class . getName ( ) ) ; if ( ( providerNames . size ( ) ) > 1 ) { throw new DeploymentUnitProcessingException ( ( "only<seq2seq4repair_space>one<seq2seq4repair_space>persistence<seq2seq4repair_space>provider<seq2seq4repair_space>can<seq2seq4repair_space>be<seq2seq4repair_space>packaged<seq2seq4repair_space>with<seq2seq4repair_space>an<seq2seq4repair_space>application<seq2seq4repair_space>" + providerNames ) ) ; } for ( String providerName : providerNames ) { try { final Class < ? extends PersistenceProvider > providerClass = classLoader . loadClass ( providerName ) . asSubclass ( PersistenceProvider . class ) ; final Constructor < ? extends PersistenceProvider > constructor = providerClass . getConstructor ( ) ; provider = constructor . newInstance ( ) ; PersistenceProviderProcessor . log . infof ( "Deployment<seq2seq4repair_space>has<seq2seq4repair_space>its<seq2seq4repair_space>own<seq2seq4repair_space>Persistence<seq2seq4repair_space>Provider<seq2seq4repair_space>%s<seq2seq4repair_space>" , providerClass ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>deploy<seq2seq4repair_space>application<seq2seq4repair_space>packaged<seq2seq4repair_space>persistence<seq2seq4repair_space>provider<seq2seq4repair_space>'" + providerName ) + "'" ) , e ) ; } } PersistenceProviderDeploymentHolder holder ; Attachable topDu = top ( deploymentUnit ) ; holder = topDu . getAttachment ( DEPLOYED_PERSISTENCE_PROVIDER ) ; if ( provider != null ) { if ( holder == null ) { holder = new PersistenceProviderDeploymentHolder ( ) ; } holder . setProvider ( provider ) ; String adapterClass = holder . getPersistenceProviderAdaptorClassName ( ) ; if ( adapterClass != null ) { try { PersistenceProviderAdaptor adaptor = ( ( PersistenceProviderAdaptor ) ( classLoader . loadClass ( adapterClass ) . newInstance ( ) ) ) ; holder . setAdapter ( adaptor ) ; <START_BUG> adaptor . setJtaManager ( JtaManagerImpl . getInstance ( ) ) ; <END_BUG> } catch ( InstantiationException e ) { throw new DeploymentUnitProcessingException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>instance<seq2seq4repair_space>of<seq2seq4repair_space>adapter<seq2seq4repair_space>class<seq2seq4repair_space>'" + adapterClass ) + "'" ) , e ) ; } catch ( IllegalAccessException e ) { throw new DeploymentUnitProcessingException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>instance<seq2seq4repair_space>of<seq2seq4repair_space>adapter<seq2seq4repair_space>class<seq2seq4repair_space>'" + adapterClass ) + "'" ) , e ) ; } catch ( ClassNotFoundException e ) { throw new DeploymentUnitProcessingException ( ( ( "could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>instance<seq2seq4repair_space>of<seq2seq4repair_space>adapter<seq2seq4repair_space>class<seq2seq4repair_space>'" + adapterClass ) + "'" ) , e ) ; } } topDu . putAttachment ( DEPLOYED_PERSISTENCE_PROVIDER , holder ) ; } } } private Attachable top ( DeploymentUnit deploymentUnit ) { } public void undeploy ( final DeploymentUnit context ) { } }

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