Buggy code:
public class PersistenceUnitDeploymentProcessor implements DeploymentUnitProcessor { public static final String JNDI_PROPERTY = "jboss.entity.manager.factory.jndi.name" ; private final PersistenceUnitRegistryImpl persistenceUnitRegistry ; public PersistenceUnitDeploymentProcessor ( PersistenceUnitRegistryImpl persistenceUnitRegistry ) { } @ 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 { if ( ( puList . size ( ) ) > 0 ) { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final Collection < ComponentDescription > components = eeModuleDescription . getComponentDescriptions ( ) ; if ( module == null ) throw JpaMessages . MESSAGES . failedToGetModuleAttachment ( phaseContext . getDeploymentUnit ( ) ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final ModuleClassLoader classLoader = module . getClassLoader ( ) ; PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = deploymentUnit . getAttachment ( DEPLOYED_PERSISTENCE_PROVIDER ) ; if ( ( persistenceProviderDeploymentHolder == null ) && ( ( deploymentUnit . getParent ( ) ) != null ) ) { persistenceProviderDeploymentHolder = deploymentUnit . getParent ( ) . getAttachment ( DEPLOYED_PERSISTENCE_PROVIDER ) ; } for ( PersistenceUnitMetadataHolder holder : puList ) { for ( PersistenceUnitMetadata pu : holder . getPersistenceUnits ( ) ) { pu . setClassLoader ( classLoader ) ; pu . setTempClassloader ( new org . jboss . as . jpa . classloader . TempClassLoader ( classLoader ) ) ; try { final HashMap properties = new HashMap ( ) ; if ( ! ( NONE . equals ( pu . getValidationMode ( ) ) ) ) { <START_BUG> ValidatorFactory validatorFactory = SerializableValidatorFactory . getINSTANCE ( ) ; <END_BUG> properties . put ( "javax.persistence.validation.factory" , validatorFactory ) ; } final PersistenceProviderAdaptor adaptor = getPersistenceProviderAdaptor ( pu , persistenceProviderDeploymentHolder ) ; final PersistenceProvider provider ; if ( ( ( persistenceProviderDeploymentHolder != null ) && ( ( persistenceProviderDeploymentHolder . getProvider ( ) ) != null ) ) && ( persistenceProviderDeploymentHolder . getProvider ( ) . getClass ( ) . getName ( ) . equals ( pu . getPersistenceProviderClassName ( ) ) ) ) { provider = persistenceProviderDeploymentHolder . getProvider ( ) ; } else { provider = lookupProvider ( pu ) ; } final PersistenceUnitServiceImpl service = new PersistenceUnitServiceImpl ( pu , adaptor , provider ) ; adaptor . addProviderProperties ( properties , pu ) ; final ServiceName puServiceName = PersistenceUnitServiceImpl . getPUServiceName ( pu ) ; this . addPUServiceDependencyToComponents ( components , puServiceName ) ; deploymentUnit . addToAttachmentList ( WEB_DEPENDENCIES , puServiceName ) ; ServiceBuilder builder = serviceTarget . addService ( puServiceName , service ) ; boolean useDefaultDataSource = true ; final String jtaDataSource = adjustJndi ( pu . getJtaDataSourceName ( ) ) ; final String nonJtaDataSource = adjustJndi ( pu . getNonJtaDataSourceName ( ) ) ; if ( ( jtaDataSource != null ) && ( ( jtaDataSource . length ( ) ) > 0 ) ) { if ( jtaDataSource . startsWith ( "java:comp" ) ) { builder . addDependency ( ContextNames . bindInfoForEnvEntry ( eeModuleDescription . getApplicationName ( ) , eeModuleDescription . getModuleName ( ) , eeModuleDescription . getModuleName ( ) , false , jtaDataSource ) . getBinderServiceName ( ) , ManagedReferenceFactory . class , new PersistenceUnitDeploymentProcessor . ManagedReferenceFactoryInjector ( service . getJtaDataSourceInjector ( ) ) ) ; useDefaultDataSource = false ; } else if ( jtaDataSource . startsWith ( "java:" ) ) { builder . addDependency ( ContextNames . bindInfoFor ( eeModuleDescription . getApplicationName ( ) , eeModuleDescription . getModuleName ( ) , eeModuleDescription . getModuleName ( ) , jtaDataSource ) . getBinderServiceName ( ) , ManagedReferenceFactory . class , new PersistenceUnitDeploymentProcessor . ManagedReferenceFactoryInjector ( service . getJtaDataSourceInjector ( ) ) ) ; useDefaultDataSource = false ; } else { builder . addDependency ( SERVICE_NAME_BASE . append ( jtaDataSource ) , new org . jboss . msc . inject . CastingInjector < DataSource > ( service . getJtaDataSourceInjector ( ) , DataSource . class ) ) ; useDefaultDataSource = false ; } } if ( ( nonJtaDataSource != null ) && ( ( nonJtaDataSource . length ( ) ) > 0 ) ) { if ( nonJtaDataSource . startsWith ( "java:comp" ) ) { builder . addDependency ( ContextNames . bindInfoForEnvEntry ( eeModuleDescription . getApplicationName ( ) , eeModuleDescription . getModuleName ( ) , eeModuleDescription . getModuleName ( ) , false , nonJtaDataSource ) . getBinderServiceName ( ) , ManagedReferenceFactory . class , new PersistenceUnitDeploymentProcessor . ManagedReferenceFactoryInjector ( service . getNonJtaDataSourceInjector ( ) ) ) ; useDefaultDataSource = false ; } else if ( nonJtaDataSource . startsWith ( "java:" ) ) { builder . addDependency ( ContextNames . bindInfoFor ( eeModuleDescription . getApplicationName ( ) , eeModuleDescription . getModuleName ( ) , eeModuleDescription . getModuleName ( ) , nonJtaDataSource ) . getBinderServiceName ( ) , ManagedReferenceFactory . class , new PersistenceUnitDeploymentProcessor . ManagedReferenceFactoryInjector ( service . getNonJtaDataSourceInjector ( ) ) ) ; useDefaultDataSource = false ; } else { builder . addDependency ( SERVICE_NAME_BASE . append ( nonJtaDataSource ) , new org . jboss . msc . inject . CastingInjector < DataSource > ( service . getNonJtaDataSourceInjector ( ) , DataSource . class ) ) ; useDefaultDataSource = false ; } } if ( useDefaultDataSource ) { final String defaultJtaDataSource = adjustJndi ( JPAService . getDefaultDataSourceName ( ) ) ; if ( ( defaultJtaDataSource != null ) && ( ( defaultJtaDataSource . length ( ) ) > 0 ) ) { builder . addDependency ( SERVICE_NAME_BASE . append ( defaultJtaDataSource ) , new org . jboss . msc . inject . CastingInjector < DataSource > ( service . getJtaDataSourceInjector ( ) , DataSource . class ) ) ;

Fix:
ValidatorFactory validatorFactory = SerializableValidatorFactory . validatorFactory ( ) ;