mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 00:24:57 +00:00
HHH-8383 ExceptionInInitializerError when changing System properties
while Environment class is initialized
This commit is contained in:
parent
4f2088856f
commit
b1759cb7c2
@ -32,14 +32,13 @@
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Version;
|
||||
import org.hibernate.bytecode.spi.BytecodeProvider;
|
||||
import org.hibernate.internal.CoreMessageLogger;
|
||||
import org.hibernate.internal.util.ConfigHelper;
|
||||
import org.hibernate.internal.util.config.ConfigurationHelper;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
|
||||
/**
|
||||
@ -240,10 +239,14 @@ public static void verifyProperties(Map<?,?> configurationValues) {
|
||||
}
|
||||
|
||||
try {
|
||||
GLOBAL_PROPERTIES.putAll( System.getProperties() );
|
||||
}
|
||||
catch (SecurityException se) {
|
||||
LOG.unableToCopySystemProperties();
|
||||
Properties systemProperties = System.getProperties();
|
||||
// Must be thread-safe in case an application changes System properties during Hibernate initialization.
|
||||
// See HHH-8383.
|
||||
synchronized (systemProperties) {
|
||||
GLOBAL_PROPERTIES.putAll(systemProperties);
|
||||
}
|
||||
} catch (SecurityException se) {
|
||||
LOG.unableToCopySystemProperties();
|
||||
}
|
||||
|
||||
verifyProperties(GLOBAL_PROPERTIES);
|
||||
|
Loading…
x
Reference in New Issue
Block a user