Fix NoClassDefFoundError for ServicePluginFactory 40/93040/2
authorsarada prasad sahoo <sarada.prasad.sahoo@huawei.com>
Thu, 8 Aug 2019 09:51:43 +0000 (15:21 +0530)
committerSeshu Kumar M <seshu.kumar.m@huawei.com>
Thu, 8 Aug 2019 11:39:02 +0000 (11:39 +0000)
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 <sarada.prasad.sahoo@huawei.com>
bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java

index 1abe1cc..579e7b7 100644 (file)
@@ -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!");
         }