[英]HIVE: Exception: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader using JDK8 on Mac
I have installed jdk8 and while running hive, I got the following information我已经安装了 jdk8 并且在运行 hive 时,我得到了以下信息
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive Session ID = f9b039ac-ca16-4fe1-ba61-aecb31e0462e
Exception in thread "main" java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:413)
at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:389)
at org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:60)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:705)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
I have tried the solutions in similar_question and similar_question , but I still got the same problem.我已经尝试了similar_question和similar_question中的解决方案,但我仍然遇到了同样的问题。 I have already set my jdk version to be jdk8:我已经将我的 jdk 版本设置为 jdk8:
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
I installed hadoop and hive using brew, and the corresponding versions are:我用brew安装了hadoop和hive,对应的版本是:
Hadoop 3.2.1
and和
Hive 3.1.2
Git git://HW13934/Users/gates/tmp/hive-branch-3.1/hive -r 8190d2be7b7165effa62bd21b7d60ef81fb0e4af
Compiled by gates on Thu Aug 22 15:01:18 PDT 2019
From source with checksum 0492c08f784b188c349f6afb1d8d9847
How can I solve this problem?我怎么解决这个问题?
I really have the same feeling as you.我真的和你有同样的感觉。 But if you don't give up, you will get it in the end.但如果你不放弃,你最终会得到它。 Good luck!祝你好运!
Hive: Exception.. class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader Hive:异常.. class jdk.internal.loader.ClassLoaders$AppClassLoader 无法转换为 class java.net.URLClassLoader
it told us to set the correct configuration.它告诉我们设置正确的配置。
cd /usr/local/Cellar/hadoop/3.2.1/sbin/
./start-all.sh
above is the terminal shell code for you to start the hadoop以上是终端shell代码,供您启动hadoop
To make sure all the nodes are started well.确保所有节点都正常启动。
also you have to configure hadoop in Pseudo-distributed mode rather than您还必须在伪分布式模式下配置 hadoop 而不是
standalone mode.独立模式。
If you can read chinese, below is also an useful article which helps me a lot.如果你会读中文,下面也是一篇有用的文章,对我有很大帮助。
https://www.jianshu.com/p/af8a50f5a653 https://www.jianshu.com/p/af8a50f5a653
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.