aboutsummaryrefslogtreecommitdiffstats
path: root/appc-dispatcher
diff options
context:
space:
mode:
Diffstat (limited to 'appc-dispatcher')
-rw-r--r--appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java
index aa6d203a5..cd9011f4b 100644
--- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java
+++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java
@@ -408,6 +408,13 @@ public abstract class AbstractRequestHandlerImpl implements RequestHandler {
if (logger.isDebugEnabled())
logger.debug("Metric getting initialized");
MetricService metricService = getMetricservice();
+ // Check for the metric service created before trying to create registry using
+ // the metricService object
+ if (metricService == null) {
+ // Cannot find service reference for org.onap.appc.metricservice.MetricService
+ throw new NullPointerException("org.onap.appc.metricservice.MetricService is null. " +
+ "Failed to init Metric");
+ }
metricRegistry = metricService.createRegistry("APPC");
DispatchingFuntionMetric dispatchingFuntionMetric = metricRegistry.metricBuilderFactory().
dispatchingFunctionCounterBuilder().