aboutsummaryrefslogtreecommitdiffstats
path: root/common/onap-common-configuration-management/onap-configuration-management-api/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'common/onap-common-configuration-management/onap-configuration-management-api/src/main')
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationLoader.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationLoader.java b/common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationLoader.java
index 8d61701a9c..78f8b23024 100644
--- a/common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationLoader.java
+++ b/common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationLoader.java
@@ -17,6 +17,7 @@
package org.onap.config.api;
import java.util.Iterator;
+import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
/**
@@ -34,8 +35,12 @@ class ConfigurationLoader {
ServiceLoader<ConfigurationManager> loader = ServiceLoader.load(ConfigurationManager.class);
Iterator<ConfigurationManager> configManagers = loader.iterator();
- if (configManagers.hasNext()) {
- return configManagers.next();
+ while (configManagers.hasNext()) {
+ try {
+ return configManagers.next();
+ } catch (ServiceConfigurationError e) {
+ // this provider loading has failed, let's try next one
+ }
}
throw new IllegalStateException("No binding found for configuration service");