Hive
  1. Hive
  2. HIVE-46

derbyclient.jar and derbytools.jar should be included in hive/lib

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Metastore
    • Labels:
      None
    • Environment:

      Cent OS 5 x86-64 JDK 1.6

      Description

      Attempting to use the Derby ClientDriver will cause a null pointer exception because derbyclient.jar and derbytools.jar are not in lib.

      hive> show tables;
      08/10/02 15:17:12 INFO hive.metastore: Trying to connect to metastore
      with URI jdbc:derby://nyhadoop1:1527/metastore_db
      FAILED: Error in semantic analysis: java.lang.NullPointerException
      08/10/02 15:17:12 ERROR ql.Driver: FAILED: Error in semantic analysis:
      java.lang.NullPointerException

      derbyclient.jar and derbytools.jar should probably be put in the hive/lib directory. Also this type of exception could happen often with different JDBC libraries the exception should be trapped better

        Activity

        Edward Capriolo created issue -
        Edward Capriolo made changes -
        Field Original Value New Value
        Summary derbyclient.jar and derbytools.jar show ship with hive derbyclient.jar and derbytools.jar should be included in hive/lib
        Description Attempting to use the Derby ClientDriver will cause a null pointer exception.

        derbyclient.jar and derbytools.jar
        javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.ClientDriver

        hive> show tables;
        08/10/02 15:17:12 INFO hive.metastore: Trying to connect to metastore
        with URI jdbc:derby://nyhadoop1:1527/metastore_db
        FAILED: Error in semantic analysis: java.lang.NullPointerException
        08/10/02 15:17:12 ERROR ql.Driver: FAILED: Error in semantic analysis:
        java.lang.NullPointerException

        derbyclient.jar and derbytools.jar should probably be put in the hive/lib directory. Also this type of exception not having the appropriate driver should be trapped and reported differently if possible.
        Attempting to use the Derby ClientDriver will cause a null pointer exception because derbyclient.jar and derbytools.jar are not in lib.

        hive> show tables;
        08/10/02 15:17:12 INFO hive.metastore: Trying to connect to metastore
        with URI jdbc:derby://nyhadoop1:1527/metastore_db
        FAILED: Error in semantic analysis: java.lang.NullPointerException
        08/10/02 15:17:12 ERROR ql.Driver: FAILED: Error in semantic analysis:
        java.lang.NullPointerException

        derbyclient.jar and derbytools.jar should probably be put in the hive/lib directory. Also this type of exception could happen often with different JDBC libraries the exception should be trapped better
        Hide
        Prasad Chakka added a comment -

        Edward,

        Could you submit a patch for this?

        Thanks,
        Prasad

        Show
        Prasad Chakka added a comment - Edward, Could you submit a patch for this? Thanks, Prasad
        Hide
        Edward Capriolo added a comment -

        I have started to look into the code. Would the correct patch for this be to trap the error and throw a new exception? Should this be a runtime exception?

        Show
        Edward Capriolo added a comment - I have started to look into the code. Would the correct patch for this be to trap the error and throw a new exception? Should this be a runtime exception?
        Hide
        Edward Capriolo added a comment -

        I am looking at this. Would the best way to handle this be to extend runtime exception with a custom error class?

        Show
        Edward Capriolo added a comment - I am looking at this. Would the best way to handle this be to extend runtime exception with a custom error class?
        Hide
        Prasad Chakka added a comment -

        Yeah, we should catch if the correct driver doesn't exist. If we start adding clients it might bloat the distribution with jars that not all of users may not need.

        Show
        Prasad Chakka added a comment - Yeah, we should catch if the correct driver doesn't exist. If we start adding clients it might bloat the distribution with jars that not all of users may not need.
        Owen O'Malley made changes -
        Component/s contrib/hive [ 12312455 ]
        Issue Type Improvement [ 4 ] Bug [ 1 ]
        Key HADOOP-4332 HIVE-46
        Project Hadoop Core [ 12310240 ] Hadoop Hive [ 12310843 ]
        Ashish Thusoo made changes -
        Component/s Build Infrastructure [ 12312593 ]
        Hide
        Prasad Chakka added a comment -

        changing the component to metastore since the bug has morphed into catching non-existent jdbc drivers for the configured in hive-site.xml

        Show
        Prasad Chakka added a comment - changing the component to metastore since the bug has morphed into catching non-existent jdbc drivers for the configured in hive-site.xml
        Prasad Chakka made changes -
        Component/s Build Infrastructure [ 12312593 ]
        Component/s Metastore [ 12312584 ]
        Hide
        Ashutosh Chauhan added a comment -

        derby.jar is now present in lib/ dir. No more NPE.

        Show
        Ashutosh Chauhan added a comment - derby.jar is now present in lib/ dir. No more NPE.
        Ashutosh Chauhan made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Carl Steinbach made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Carl Steinbach made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Not A Problem [ 8 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Edward Capriolo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development