Re: jdk11创建hive catalog抛错

2021-11-22 文章 Caizhi Weng
Hi!

这是从 hive 里产生的错误。据我所知,hive 对 Java 11 的支持仍在建设中 [1],因此还是建议使用 Java 8。

[1] https://issues.apache.org/jira/browse/HIVE-22415

aiden <18765295...@163.com> 于2021年11月22日周一 下午12:00写道:

> 求助,jdk从8升级到11后使用hive作为flink
> table的catalog抛错,排查是bsTableEnv.registerCatalog(catalogName, catalog)
> 抛错,具体异常为:
> 11:55:22.343 [main] ERROR hive.log - Got exception:
> java.lang.ClassCastException class [Ljava.lang.Object; cannot be cast to
> class [Ljava.net.URI; ([Ljava.lang.Object; and [Ljava.net.URI; are in
> module java.base of loader 'bootstrap')
> java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to
> class [Ljava.net.URI; ([Ljava.lang.Object; and [Ljava.net.URI; are in
> module java.base of loader 'bootstrap')
> at
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.(HiveMetaStoreClient.java:274)
> [hive-exec-2.1.1.jar:2.1.1]
> at
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.(HiveMetaStoreClient.java:210)
> [hive-exec-2.1.1.jar:2.1.1]
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method) ~[?:?]
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> [?:?]
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> [?:?]
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
> [?:?]
> at
> org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1652)
> [hive-exec-2.1.1.jar:2.1.1]
> at
> org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.(RetryingMetaStoreClient.java:80)
> [hive-exec-2.1.1.jar:2.1.1]
> at
> org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:130)
> [hive-exec-2.1.1.jar:2.1.1]
> at
> org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:115)
> [hive-exec-2.1.1.jar:2.1.1]
> 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.apache.flink.table.catalog.hive.client.HiveShimV200.getHiveMetastoreClient(HiveShimV200.java:54)
> [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
> at
> org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.createMetastoreClient(HiveMetastoreClientWrapper.java:277)
> [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
> at
> org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.(HiveMetastoreClientWrapper.java:78)
> [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
> at
> org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.(HiveMetastoreClientWrapper.java:68)
> [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
> at
> org.apache.flink.table.catalog.hive.client.HiveMetastoreClientFactory.create(HiveMetastoreClientFactory.java:32)
> [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
> at
> org.apache.flink.table.catalog.hive.HiveCatalog.open(HiveCatalog.java:296)
> [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
> at
> org.apache.flink.table.catalog.CatalogManager.registerCatalog(CatalogManager.java:195)
> [flink-table-api-java-1.14.0.jar:1.14.0]
> at
> org.apache.flink.table.api.internal.TableEnvironmentImpl.registerCatalog(TableEnvironmentImpl.java:373)
> [flink-table-api-java-1.14.0.jar:1.14.0]
> at catalogTest.FlinkExecTableRun.flinkMain(FlinkExecTableRun.java:27)
> [classes/:?]
> at catalogTest.test.main(test.java:11) [classes/:?]
> 11:55:22.348 [main] ERROR hive.log - Converting exception to MetaException
> Exception in thread "main"
> org.apache.flink.table.catalog.exceptions.CatalogException: Failed to
> create Hive Metastore client
> at
> org.apache.flink.table.catalog.hive.client.HiveShimV200.getHiveMetastoreClient(HiveShimV200.java:61)
> at
> org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.createMetastoreClient(HiveMetastoreClientWrapper.java:277)
> at
> org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.(HiveMetastoreClientWrapper.java:78)
> at
> org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.(HiveMetastoreClientWrapper.java:68)
> at
> org.apache.flink.table.catalog.hive.client.HiveMetastoreClientFactory.create(HiveMetastoreClientFactory.java:32)
> at
> org.apache.flink.table.catalog.hive.HiveCatalog.open(HiveCatalog.java:296)
> at
> org.apache.flink.table.catalog.CatalogManager.registerCatalog(CatalogManager.java:195)
> at
> org.apache.flink.table.api.internal.TableEnvironmentImpl.registerCatalog(TableEnvironmentImpl.java:373)
> at catalogTest.FlinkExecTableRun.flinkMain(FlinkExecTableRun.java:27)
> at catalogTest.test.main(test.java:11)
> Caused by: java.lang.reflect.InvocationTargetException

jdk11创建hive catalog抛错

2021-11-21 文章 aiden
求助,jdk从8升级到11后使用hive作为flink 
table的catalog抛错,排查是bsTableEnv.registerCatalog(catalogName, catalog) 抛错,具体异常为:
11:55:22.343 [main] ERROR hive.log - Got exception: 
java.lang.ClassCastException class [Ljava.lang.Object; cannot be cast to class 
[Ljava.net.URI; ([Ljava.lang.Object; and [Ljava.net.URI; are in module 
java.base of loader 'bootstrap')
java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class 
[Ljava.net.URI; ([Ljava.lang.Object; and [Ljava.net.URI; are in module 
java.base of loader 'bootstrap')
at 
org.apache.hadoop.hive.metastore.HiveMetaStoreClient.(HiveMetaStoreClient.java:274)
 [hive-exec-2.1.1.jar:2.1.1]
at 
org.apache.hadoop.hive.metastore.HiveMetaStoreClient.(HiveMetaStoreClient.java:210)
 [hive-exec-2.1.1.jar:2.1.1]
at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method) ~[?:?]
at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 [?:?]
at 
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 [?:?]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) 
[?:?]
at 
org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1652)
 [hive-exec-2.1.1.jar:2.1.1]
at 
org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.(RetryingMetaStoreClient.java:80)
 [hive-exec-2.1.1.jar:2.1.1]
at 
org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:130)
 [hive-exec-2.1.1.jar:2.1.1]
at 
org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:115)
 [hive-exec-2.1.1.jar:2.1.1]
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.apache.flink.table.catalog.hive.client.HiveShimV200.getHiveMetastoreClient(HiveShimV200.java:54)
 [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
at 
org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.createMetastoreClient(HiveMetastoreClientWrapper.java:277)
 [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
at 
org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.(HiveMetastoreClientWrapper.java:78)
 [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
at 
org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.(HiveMetastoreClientWrapper.java:68)
 [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
at 
org.apache.flink.table.catalog.hive.client.HiveMetastoreClientFactory.create(HiveMetastoreClientFactory.java:32)
 [flink-connector-hive_2.11-1.14.0.jar:1.14.0]
at org.apache.flink.table.catalog.hive.HiveCatalog.open(HiveCatalog.java:296) 
[flink-connector-hive_2.11-1.14.0.jar:1.14.0]
at 
org.apache.flink.table.catalog.CatalogManager.registerCatalog(CatalogManager.java:195)
 [flink-table-api-java-1.14.0.jar:1.14.0]
at 
org.apache.flink.table.api.internal.TableEnvironmentImpl.registerCatalog(TableEnvironmentImpl.java:373)
 [flink-table-api-java-1.14.0.jar:1.14.0]
at catalogTest.FlinkExecTableRun.flinkMain(FlinkExecTableRun.java:27) 
[classes/:?]
at catalogTest.test.main(test.java:11) [classes/:?]
11:55:22.348 [main] ERROR hive.log - Converting exception to MetaException
Exception in thread "main" 
org.apache.flink.table.catalog.exceptions.CatalogException: Failed to create 
Hive Metastore client
at 
org.apache.flink.table.catalog.hive.client.HiveShimV200.getHiveMetastoreClient(HiveShimV200.java:61)
at 
org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.createMetastoreClient(HiveMetastoreClientWrapper.java:277)
at 
org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.(HiveMetastoreClientWrapper.java:78)
at 
org.apache.flink.table.catalog.hive.client.HiveMetastoreClientWrapper.(HiveMetastoreClientWrapper.java:68)
at 
org.apache.flink.table.catalog.hive.client.HiveMetastoreClientFactory.create(HiveMetastoreClientFactory.java:32)
at org.apache.flink.table.catalog.hive.HiveCatalog.open(HiveCatalog.java:296)
at 
org.apache.flink.table.catalog.CatalogManager.registerCatalog(CatalogManager.java:195)
at 
org.apache.flink.table.api.internal.TableEnvironmentImpl.registerCatalog(TableEnvironmentImpl.java:373)
at catalogTest.FlinkExecTableRun.flinkMain(FlinkExecTableRun.java:27)
at catalogTest.test.main(test.java:11)
Caused by: java.lang.reflect.InvocationTargetException
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.