SpringProperties falls back to ClassLoader.getSystemResource when loaded in bootstrap ClassLoader
Issue: SPR-11721
This commit is contained in:
@@ -55,7 +55,8 @@ public abstract class SpringProperties {
|
|||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
ClassLoader cl = SpringProperties.class.getClassLoader();
|
ClassLoader cl = SpringProperties.class.getClassLoader();
|
||||||
URL url = cl.getResource(PROPERTIES_RESOURCE_LOCATION);
|
URL url = (cl != null ? cl.getResource(PROPERTIES_RESOURCE_LOCATION) :
|
||||||
|
ClassLoader.getSystemResource(PROPERTIES_RESOURCE_LOCATION));
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
logger.info("Found 'spring.properties' file in local classpath");
|
logger.info("Found 'spring.properties' file in local classpath");
|
||||||
InputStream is = url.openStream();
|
InputStream is = url.openStream();
|
||||||
|
|||||||
Reference in New Issue
Block a user