Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-22870

reflection fails to access a private nested class

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5
    • Fix Version/s: 3.0.0, 2.3.0, 2.2.1, 2.1.6
    • Component/s: master
    • Labels:
      None

      Description

      HMaster crashes at org/apache/hadoop/hbase/regionserver/HRegionServer.java:1044
      A private static nested class can not be instantiated via reflection.

      code snippet

       

       
      try {
      abortTimeoutTask =
      Class.forName(conf.get(ABORT_TIMEOUT_TASK, SystemExitWhenAbortTimeout.class.getName()))
      .asSubclass(TimerTask.class).getDeclaredConstructor().newInstance();
      } catch (Exception e) {
      LOG.warn("Initialize abort timeout task failed", e);
      }

       

       

      log in product environtment

      2019-08-16 18:01:40,737 [WARN ] HRegionServer:1046 Initialize abort timeout task failed
       java.lang.IllegalAccessException: Class org.apache.hadoop.hbase.regionserver.HRegionServer can not access a member of class org.apache.hadoop.hbase.regionss
       erver.HRegionServer$SystemExitWhenAbortTimeout with modifiers "private"
       at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
       at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
       at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:413)
       at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:1044)
       at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:598)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                satanson ranpanfeng
                Reporter:
                satanson ranpanfeng
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified