求助,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.Method.invoke(Method.java:566) at org.apache.flink.table.catalog.hive.client.HiveShimV200.getHiveMetastoreClient(HiveShimV200.java:54) ... 9 more Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1654) at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient. (RetryingMetaStoreClient.java:80) at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:130) at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:115) ... 14 more Caused by: java.lang.reflect.InvocationTargetException 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) ... 17 more Caused by: MetaException(message: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')) at org.apache.hadoop.hive.metastore.MetaStoreUtils.logAndThrowMetaException(MetaStoreUtils.java:1342) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient. (HiveMetaStoreClient.java:278) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient. (HiveMetaStoreClient.java:210) *来自志愿者整理的flink邮件归档
Hi!
这是从 hive 里产生的错误。据我所知,hive 对 Java 11 的支持仍在建设中 [1],因此还是建议使用 Java 8。
[1] https://issues.apache.org/jira/browse/HIVE-22415*来自志愿者整理的flink邮件归档
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。