Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-1370

AccumuloUtils can throw NPE when zookeeper or accumulo home is null

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.4
    • Fix Version/s: 1.4.5
    • Component/s: None
    • Labels:

      Description

      AccumuloUtils is creating a new File objects in method addJars using Accumulo and Zookeeper home directory. However those variables can be null resulting in this ugly exception:

      14/07/11 12:26:35 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException
      java.lang.NullPointerException
      	at java.io.File.<init>(File.java:277)
      	at org.apache.sqoop.accumulo.AccumuloUtil.addJars(AccumuloUtil.java:114)
      	at org.apache.sqoop.mapreduce.AccumuloImportJob.jobSetup(AccumuloImportJob.java:164)
      	at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:245)
      	at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:614)
      	at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:118)
      	at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:413)
      	at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:506)
      	at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      	at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
      	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:222)
      	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:231)
      	at org.apache.sqoop.Sqoop.main(Sqoop.java:240)
      

        Activity

        Hide
        mdrob Mike Drob added a comment -

        Jarek Jarcec Cecho - what kind of behaviour would you prefer to see? Check for null and throw as IOException?

        Show
        mdrob Mike Drob added a comment - Jarek Jarcec Cecho - what kind of behaviour would you prefer to see? Check for null and throw as IOException?
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        As the home directories are required at that point then yes, I would like to see check for null with raising exception if needed. Perhaps RuntimeException will make more sense then IOException?

        Show
        jarcec Jarek Jarcec Cecho added a comment - As the home directories are required at that point then yes, I would like to see check for null with raising exception if needed. Perhaps RuntimeException will make more sense then IOException ?
        Hide
        mdrob Mike Drob added a comment -

        Patch applies to trunk.

        Show
        mdrob Mike Drob added a comment - Patch applies to trunk.
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        +1

        Show
        jarcec Jarek Jarcec Cecho added a comment - +1
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 9aac957b9c0e9f6c644df5cb529d5cd1a118dff8 in sqoop's branch refs/heads/trunk from Jarek Jarcec Cecho
        [ https://git-wip-us.apache.org/repos/asf?p=sqoop.git;h=9aac957 ]

        SQOOP-1370: AccumuloUtils can throw NPE when zookeeper or accumulo home is null

        (Mike Drob via Jarek Jarcec Cecho)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 9aac957b9c0e9f6c644df5cb529d5cd1a118dff8 in sqoop's branch refs/heads/trunk from Jarek Jarcec Cecho [ https://git-wip-us.apache.org/repos/asf?p=sqoop.git;h=9aac957 ] SQOOP-1370 : AccumuloUtils can throw NPE when zookeeper or accumulo home is null (Mike Drob via Jarek Jarcec Cecho)
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Thank you for your contribution Mike Drob!

        Show
        jarcec Jarek Jarcec Cecho added a comment - Thank you for your contribution Mike Drob !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop23 #1101 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/1101/)
        SQOOP-1370: AccumuloUtils can throw NPE when zookeeper or accumulo home is null (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=9aac957b9c0e9f6c644df5cb529d5cd1a118dff8)

        • src/java/org/apache/sqoop/accumulo/AccumuloUtil.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop23 #1101 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/1101/ ) SQOOP-1370 : AccumuloUtils can throw NPE when zookeeper or accumulo home is null (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=9aac957b9c0e9f6c644df5cb529d5cd1a118dff8 ) src/java/org/apache/sqoop/accumulo/AccumuloUtil.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Sqoop-ant-jdk-1.6-hadoop20 #898 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/898/)
        SQOOP-1370: AccumuloUtils can throw NPE when zookeeper or accumulo home is null (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=9aac957b9c0e9f6c644df5cb529d5cd1a118dff8)

        • src/java/org/apache/sqoop/accumulo/AccumuloUtil.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Sqoop-ant-jdk-1.6-hadoop20 #898 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/898/ ) SQOOP-1370 : AccumuloUtils can throw NPE when zookeeper or accumulo home is null (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=9aac957b9c0e9f6c644df5cb529d5cd1a118dff8 ) src/java/org/apache/sqoop/accumulo/AccumuloUtil.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop200 #904 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/904/)
        SQOOP-1370: AccumuloUtils can throw NPE when zookeeper or accumulo home is null (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=9aac957b9c0e9f6c644df5cb529d5cd1a118dff8)

        • src/java/org/apache/sqoop/accumulo/AccumuloUtil.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop200 #904 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/904/ ) SQOOP-1370 : AccumuloUtils can throw NPE when zookeeper or accumulo home is null (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=9aac957b9c0e9f6c644df5cb529d5cd1a118dff8 ) src/java/org/apache/sqoop/accumulo/AccumuloUtil.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop100 #863 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/863/)
        SQOOP-1370: AccumuloUtils can throw NPE when zookeeper or accumulo home is null (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=9aac957b9c0e9f6c644df5cb529d5cd1a118dff8)

        • src/java/org/apache/sqoop/accumulo/AccumuloUtil.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop100 #863 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/863/ ) SQOOP-1370 : AccumuloUtils can throw NPE when zookeeper or accumulo home is null (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=9aac957b9c0e9f6c644df5cb529d5cd1a118dff8 ) src/java/org/apache/sqoop/accumulo/AccumuloUtil.java

          People

          • Assignee:
            mdrob Mike Drob
            Reporter:
            jarcec Jarek Jarcec Cecho
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development