From c9aa0646809f12aeec37e463e7a03b96a2738476 Mon Sep 17 00:00:00 2001 From: sarada prasad sahoo Date: Thu, 8 Aug 2019 15:21:43 +0530 Subject: Fix NoClassDefFoundError for ServicePluginFactory Fix NoClassDefFoundError for ServicePluginFactory appears when we run SO via docker-compose command Change-Id: I8ba5963edf28f81d948f71a9d698541f682de908 Issue-ID: SO-2206 Signed-off-by: sarada prasad sahoo --- .../workflow/service/ServicePluginFactory.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java index 1abe1ccc73..579e7b72df 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java @@ -98,12 +98,17 @@ public class ServicePluginFactory { new String[] {VS_MONITORED, VS_UNMONITORED, TS_MONITORED, TS_UNMONITORED}; static { - try (InputStream is = ClassLoader.class.getResourceAsStream("/application.properties")) { - Properties prop = new Properties(); - prop.load(is); - OOF_DEFAULT_ENDPOINT = prop.getProperty("oof.default.endpoint"); - THIRD_SP_DEFAULT_ENDPOINT = prop.getProperty("third.sp.default.endpoint"); - INVENTORY_OSS_DEFAULT_ENDPOINT = prop.getProperty("inventory.oss.default.endpoint"); + try { + InputStream is = ClassLoader.class.getResourceAsStream("/application.properties"); + if (null != is) { + Properties prop = new Properties(); + prop.load(is); + OOF_DEFAULT_ENDPOINT = prop.getProperty("oof.default.endpoint"); + THIRD_SP_DEFAULT_ENDPOINT = prop.getProperty("third.sp.default.endpoint"); + INVENTORY_OSS_DEFAULT_ENDPOINT = prop.getProperty("inventory.oss.default.endpoint"); + } else { + logger.error("Failed to load property file, Either property file is missing or empty!"); + } } catch (IOException e) { logger.error("Failed to load property file!"); } -- cgit 1.2.3-korg