Error in Jetty logs 33/23333/1
authorsheetalm <sheetal.mudholkar@amdocs.com>
Wed, 8 Nov 2017 07:39:07 +0000 (13:09 +0530)
committerMichael Lando <ml636r@att.com>
Mon, 13 Nov 2017 11:27:54 +0000 (11:27 +0000)
Fixed code from Configuration Management that was causing exception

Change-Id: Iea5461530a1b8a548a95c86f2d5c38b965dbb45f
Issue-ID: SDC-580
Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
(cherry picked from commit 703240858e26a8efbea199214ebcaf1bd2709163)

common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/ContextListener.java

index a355073..06652c0 100644 (file)
@@ -2,18 +2,12 @@ package org.openecomp.config.impl;
 
 import static org.openecomp.config.Constants.MBEAN_NAME;
 
-import org.apache.commons.beanutils.FluentPropertyBeanIntrospector;
-import org.openecomp.config.api.ConfigurationManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.lang.management.ManagementFactory;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
 import javax.management.ObjectName;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 import javax.servlet.annotation.WebListener;
+import org.openecomp.config.api.ConfigurationManager;
 
 @WebListener
 public class ContextListener implements ServletContextListener {
@@ -29,20 +23,6 @@ public class ContextListener implements ServletContextListener {
 
   @Override
   public void contextInitialized(ServletContextEvent arg0) {
-    try {
-      ConfigurationManager.lookup();
-      Logger logger = LoggerFactory.getLogger(FluentPropertyBeanIntrospector.class);
-      Method method = logger.getClass().getDeclaredMethod("getLevel");
-      method.setAccessible(true);
-      Object object = method.invoke(logger);
-      method = logger.getClass().getDeclaredMethod("setLevel", object.getClass());
-      method.setAccessible(true);
-      Field field = object.getClass().getDeclaredField("ERROR");
-      field.setAccessible(true);
-      method.invoke(logger, field.get(logger));
-    } catch (Exception exception) {
-      exception.printStackTrace();
-    }
+    ConfigurationManager.lookup();
   }
-
 }