diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 405d75adb97..587e7f62149 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -1047,9 +1047,11 @@ public class HRegionServer extends HasThread implements Timer abortMonitor = new Timer("Abort regionserver monitor", true); TimerTask abortTimeoutTask = null; try { - abortTimeoutTask = - Class.forName(conf.get(ABORT_TIMEOUT_TASK, SystemExitWhenAbortTimeout.class.getName())) - .asSubclass(TimerTask.class).getDeclaredConstructor().newInstance(); + Constructor timerTaskCtor = + Class.forName(conf.get(ABORT_TIMEOUT_TASK, SystemExitWhenAbortTimeout.class.getName())) + .asSubclass(TimerTask.class).getDeclaredConstructor(); + timerTaskCtor.setAccessible(true); + abortTimeoutTask = timerTaskCtor.newInstance(); } catch (Exception e) { LOG.warn("Initialize abort timeout task failed", e); }