You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Sudhanshu Arora (JIRA)" <ji...@apache.org> on 2012/12/13 20:58:12 UTC

[jira] [Created] (HIVE-3799) Better error message if metalisteners or hookContext cannot be loaded/instantiated

Sudhanshu Arora created HIVE-3799:
-------------------------------------

             Summary: Better error message if metalisteners or hookContext cannot be loaded/instantiated
                 Key: HIVE-3799
                 URL: https://issues.apache.org/jira/browse/HIVE-3799
             Project: Hive
          Issue Type: Bug
          Components: Logging
    Affects Versions: 0.9.0
            Reporter: Sudhanshu Arora


If I am not able to instantiate MetaListener or HookContext because of some dependent class missing, the only error I get is InvocationTargetException.  MetaStoreUtils.getMetaListener should be changed as following:
try {
        T listener = (T) Class.forName(
            listenerImpl.trim(), true, JavaUtils.getClassLoader()).getConstructor(
                Configuration.class).newInstance(conf);
        listeners.add(listener);
      } catch (InvocationTargetException e) {
        throw new MetaException("Failed to instantiate listener named: "+
            listenerImpl + " reason: " + e.getCause().toString());
      } catch (Exception e) {
        throw new MetaException("Failed to instantiate listener named: "+
            listenerImpl + " reason: " + e.toString());
      }

Similarly Driver.getHooks should be changed to handle InvocationTargetException in a better way.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira