简体   繁体   English

HIVE:异常:class jdk.internal.loader.ClassLoaders$AppClassLoader 无法在 Mac 上使用 JDK8 转换为 class java.net.URLClassLoader

[英]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_questionsimilar_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!祝你好运!

  1. You can definitely find something helpful in this article你绝对可以在这篇文章中找到有用的东西

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.它告诉我们设置正确的配置。

  1. You have to make sure that you start your hadoop cluster before running hive and also guarantee that all the services are running normally.您必须确保在运行 hive 之前启动您的 hadoop 集群,并保证所有服务都正常运行。
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

  1. [important] [重要的]

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.

相关问题 异常 class jdk.internal.loader.ClassLoaders$AppClassLoader 无法转换为 class java.net.URLClassLoader - Exception class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader 基于 Java 的 Azure 函数 - 异常:ClassCastException:无法转换 class jdk.internal.loader.ClassLoaders$AppClassLoader - Java based Azure Function - Exception: ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast Ubuntu Minecraft 服务器 java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader - Ubuntu Minecraft Server java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader Hive:虽然使用 JDK8,但无法将 AppClassLoader 强制转换为 URLClassLoader - Hive: AppClassLoader cannot be cast to URLClassLoader although using JDK8 java.lang.reflect.inaccessibleobjectexception 无法使 jdk.internal.loader.classloaders - java.lang.reflect.inaccessibleobjectexception unable to make jdk.internal.loader.classloaders dalvik.system.PathClassLoader 不能转换为 java.net.URLClassLoader - dalvik.system.PathClassLoader cannot be cast to java.net.URLClassLoader java.net.URLClassLoader不添加类注释 - java.net.URLClassLoader doesn't add class annotations JDK9或以下版本中JDK9 +中的java.util.SubList类的等效类 - Equivalent class in JDK9+ for java.util.SubList class in JDK8 or below 如果类加载器在签名的 JAR 中,则在 JDK 11.0.11 上使用“-Djava.system.class.loader”时出现异常 - Exception when using '-Djava.system.class.loader' on JDK 11.0.11, if class loader is in signed JAR Java ClassLoaders - 将 class 转换为接口 - Java ClassLoaders - Cast class to an interface
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM