You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "tartarus (Jira)" <ji...@apache.org> on 2022/04/29 06:36:00 UTC

[jira] [Created] (FLINK-27450) [JDK 11] Hive SessionState can't be initialized due to classloader problem

tartarus created FLINK-27450:
--------------------------------

             Summary: [JDK 11] Hive SessionState can't be initialized due to classloader problem
                 Key: FLINK-27450
                 URL: https://issues.apache.org/jira/browse/FLINK-27450
             Project: Flink
          Issue Type: Improvement
          Components: Connectors / Hive
    Affects Versions: 1.15.0, 1.13.1
            Reporter: tartarus


If we use jdk11 to run Hive related jobs, there will be a problem that the Hive SessionState cannot be initialized

{code:java}
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:394)
	at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:370)
	at org.apache.flink.table.planner.delegation.hive.HiveParser$HiveParserSessionState.<init>(HiveParser.java:382)
	at org.apache.flink.table.planner.delegation.hive.HiveParser.startSessionState(HiveParser.java:306)
	at org.apache.flink.table.planner.delegation.hive.HiveParser.parse(HiveParser.java:205)
	at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeSql(TableEnvironmentImpl.java:695)
	at org.apache.flink.connectors.hive.HiveDialectQueryITCase.setup(HiveDialectQueryITCase.java:74)
	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:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
{code}

Refer to [HIVE-21237|https://issues.apache.org/jira/browse/HIVE-21237], choose hive version 2.3.7 to support jdk11

We have been running in production for a long time




--
This message was sent by Atlassian Jira
(v8.20.7#820007)