当前位置: 首页 > 工具软件 > HCatalog > 使用案例 >

Hive: java.lang.ClassNotFoundException Class org.apache.hive.hcatalog.data.JsonSerDe not found

通煜祺
2023-12-01
WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X
 releases.
Query ID = root_20210225123435_1324c293-cd8b-42be-802d-339619ddd885
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>
Starting Job = job_1614243858234_0028, Tracking URL = http://hadoop-master:8088/proxy/application_1614243858234_0028/
Kill Command = /usr/local/hadoop/bin/hadoop job  -kill job_1614243858234_0028
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 1
2021-02-25 12:34:42,249 Stage-1 map = 0%,  reduce = 0%
2021-02-25 12:34:59,995 Stage-1 map = 100%,  reduce = 0%
2021-02-25 12:35:01,017 Stage-1 map = 100%,  reduce = 100%
Ended Job = job_1614243858234_0028 with errors
Error during job, obtaining debugging information...
Examining task ID: task_1614243858234_0028_m_000000 (and more) from job job_1614243858234_0028

Task with the most failures(4):
-----
Task ID:
  task_1614243858234_0028_m_000000

URL:
  http://hadoop-master:8088/taskdetails.jsp?jobid=job_1614243858234_0028&tipid=task_1614243858234_0028_m_000000
-----
Diagnostic Messages for this Task:
Error: java.lang.RuntimeException: Error in configuring object
        at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
        at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
        at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:449)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
        ... 9 more
Caused by: java.lang.RuntimeException: Error in configuring object
        at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
        at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
        at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
        ... 14 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
        ... 17 more
Caused by: java.lang.RuntimeException: Map operator initialization failed
        at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:125)
        ... 22 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassNotFoundException: Class org.apache.hive.hcatalog.data.JsonSerDe not found
        at org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:328)
        at org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:420)
        at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:94)
        ... 22 more
Caused by: java.lang.ClassNotFoundException: Class org.apache.hive.hcatalog.data.JsonSerDe not found
        at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2101)
        at org.apache.hadoop.hive.ql.plan.PartitionDesc.getDeserializer(PartitionDesc.java:177)
        at org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:295)
        ... 24 more


FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched:
Stage-Stage-1: Map: 1  Reduce: 1   HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec

这段错误困扰了我很久,终于搞定了,总之就是开心

观察Hive的日志信息,可以看出抛出该问题是由org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore引起的,

cp $HIVE_HOME/hive-1.2.2/hcatalog/hive-hcatalog-core-1.2.2.jar $HIVE_HOME/hive-1.2.2/lib

之后在$HIVE_HOME/conf下,找到hive-env.sh修改HIVE_AUX_JARS_PATH内容,即添加如下使其在MR时生效

export HIVE_AUX_JARS_PATH=$HIVE_HOME/hcatalog/share/hcatalog/hive-hcatalog-core-1.2.2.jar

重启Hive,然后解决。

 类似资料:

相关阅读

相关文章

相关问答