Java自学者论坛

 找回密码
 立即注册

手机号码,快捷登录

恭喜Java自学者论坛(https://www.javazxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,会员资料板块,购买链接:点击进入购买VIP会员

JAVA高级面试进阶训练营视频教程

Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程Go语言视频零基础入门到精通Java架构师3期(课件+源码)
Java开发全终端实战租房项目视频教程SpringBoot2.X入门到高级使用教程大数据培训第六期全套视频教程深度学习(CNN RNN GAN)算法原理Java亿级流量电商系统视频教程
互联网架构师视频教程年薪50万Spark2.0从入门到精通年薪50万!人工智能学习路线教程年薪50万大数据入门到精通学习路线年薪50万机器学习入门到精通教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程MySQL入门到精通教程
查看: 860|回复: 0

hive遇到的问题以及解决办法

[复制链接]
  • TA的每日心情
    奋斗
    6 天前
  • 签到天数: 803 天

    [LV.10]以坛为家III

    2053

    主题

    2111

    帖子

    72万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    726482
    发表于 2021-5-15 19:17:08 | 显示全部楼层 |阅读模式

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

    hadoop    | Error: java.lang.RuntimeException: Error in configuring object
    hadoop    | 	at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:113)
    hadoop    | 	at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:79)
    hadoop    | 	at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:137)
    hadoop    | 	at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:455)
    hadoop    | 	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
    hadoop    | 	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:177)
    hadoop    | 	at java.security.AccessController.doPrivileged(Native Method)
    hadoop    | 	at javax.security.auth.Subject.doAs(Subject.java:422)
    hadoop    | 	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1886)
    hadoop    | 	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:171)
    hadoop    | Caused by: java.lang.reflect.InvocationTargetException
    hadoop    | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    hadoop    | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    hadoop    | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    hadoop    | 	at java.lang.reflect.Method.invoke(Method.java:498)
    hadoop    | 	at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:110)
    hadoop    | 	... 9 more
    hadoop    | Caused by: java.lang.RuntimeException: Error in configuring object
    hadoop    | 	at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:113)
    hadoop    | 	at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:79)
    hadoop    | 	at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:137)
    hadoop    | 	at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
    hadoop    | 	... 14 more
    hadoop    | Caused by: java.lang.reflect.InvocationTargetException
    hadoop    | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    hadoop    | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    hadoop    | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    hadoop    | 	at java.lang.reflect.Method.invoke(Method.java:498)
    hadoop    | 	at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:110)
    hadoop    | 	... 17 more
    hadoop    | Caused by: java.lang.RuntimeException: Map operator initialization failed
    hadoop    | 	at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:137)
    hadoop    | 	... 22 more
    hadoop    | Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassNotFoundException: Class org.apache.hive.hcatalog.data.JsonSerDe not found
    hadoop    | 	at org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:328)
    hadoop    | 	at org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:420)
    hadoop    | 	at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:106)
    hadoop    | 	... 22 more
    hadoop    | Caused by: java.lang.ClassNotFoundException: Class org.apache.hive.hcatalog.data.JsonSerDe not found
    hadoop    | 	at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2299)
    hadoop    | 	at org.apache.hadoop.hive.ql.plan.PartitionDesc.getDeserializer(PartitionDesc.java:177)
    hadoop    | 	at org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:295)
    hadoop    | 	... 24 more
    hadoop    | 
    hadoop    | 
    hadoop    | FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
    hadoop    | MapReduce Jobs Launched: 
    hadoop    | Stage-Stage-1: Map: 1  Reduce: 1   HDFS Read: 0 HDFS Write: 0 FAIL
    hadoop    | Total MapReduce CPU Time Spent: 0 msec
    

     

    解决办法:

    方法一:添加add hive-hcatalog-core包

    ADD JAR /usr/local/hive/lib/hive-hcatalog-core-2.3.2.jar;

     

    方法二:Jar放入${HIVE_HOME}/auxlib目录(这个方法解决了我的问题)

    在${HIVE_HOME}建立一个auxlib目录,把hive-hcatalog-core.xxx.jar放到auxlib目录,重启hiverserver2,成功显示OK

    哎...今天够累的,签到来了1...
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|Java自学者论坛 ( 声明:本站文章及资料整理自互联网,用于Java自学者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

    GMT+8, 2024-11-23 21:04 , Processed in 1.149524 second(s), 29 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表