6

执行任何命令时,我在 Hive 中收到以下错误。

hive> show tables;
FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

这在 hive.log 中。

2011-07-27 19:10:57,526 ERROR exec.DDLTask (SessionState.java:printError(343)) - FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException
org.apache.hadoop.hive.ql.metadata.HiveException: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException
        at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1028)
        at org.apache.hadoop.hive.ql.metadata.Hive.databaseExists(Hive.java:1013)
        at org.apache.hadoop.hive.ql.exec.DDLTask.showTables(DDLTask.java:1691)
        at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:289)
        at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:130)
        at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
        at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1063)
        at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:900)
        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:748)
        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException
        at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1186)
        at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:803)
        at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
        at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:234)
        at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:261)
        at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:196)
        at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:171)
        at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
        at org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:255)
        at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:182)
        ... 41 more

元数据库显然存在问题,但错误非常隐晦,安装指南没有说明配置元数据库的任何内容。

4

2 回答 2

7

我遇到了同样的问题。
解决方案是下载此文件:https ://www.mysql.com/downloads/connector/j/ ,解压缩,将 jar 从内部复制到位置:(/usr/lib/hive/lib在您的情况下可能会有所不同 - 这是配置单元库所在的位置位于)

于 2011-07-28T11:39:01.087 回答
4

我在这里找到了答案:

http://getsatisfaction.com/cloudera/topics/hive_error_error_in_metadata_javax_jdo_jdofatalinternalexception

“Shirish Reddy:删除$HADOOP_HOME/build,一切都应该没问题。从郑复制的回复”

奇怪的是,删除 $HADOOP_HOME/build 后问题就消失了。

于 2011-07-28T21:58:52.213 回答