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

TestTableResource fails with NPE

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 1.5.0, 1.3.3, 2.1.1, 2.0.2, 1.4.7
    • Fix Version/s: 3.0.0, 1.3.3, 2.2.0, 1.2.7, 2.1.1, 2.0.2, 1.4.7
    • Component/s: REST, test
    • Labels:
      None

      Description

      The following can be observed in master branch:

      java.lang.NullPointerException
      	at org.apache.hadoop.hbase.rest.TestTableResource.setUpBeforeClass(TestTableResource.java:134)
      

      The NPE comes from the following in TestEndToEndSplitTransaction :

              compactAndBlockUntilDone(TEST_UTIL.getAdmin(),
                TEST_UTIL.getMiniHBaseCluster().getRegionServer(0), daughterA.getRegionName());
      

      Initial check of the code shows that TestEndToEndSplitTransaction uses TEST_UTIL instance which is created within TestEndToEndSplitTransaction. However, TestTableResource creates its own instance of HBaseTestingUtility.
      Meaning TEST_UTIL.getMiniHBaseCluster() would return null, since the instance created by TestEndToEndSplitTransaction has hbaseCluster as null.

        Attachments

        1. HBASE-21076.1.patch
          7 kB
          Sean Busbey
        2. HBASE-21076.0.patch
          5 kB
          Sean Busbey

          Issue Links

            Activity

              People

              • Assignee:
                busbey Sean Busbey
                Reporter:
                yuzhihong@gmail.com Ted Yu
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: