2

我按照这个例子从本地机器连接到 Bigtable 。当我使用 JDK 7 运行我的项目时,一切都很完美,但是当我使用 JDK 8 运行它时,我有以下几点:

Exception in thread "main" java.io.IOException: Failed to create table 'testTable'
at org.apache.hadoop.hbase.client.BigtableAdmin.createTable(BigtableAdmin.java:306)
at com.zoomdata.thrift.provider.BigTableTestConnector.testConnection(BigTableTestConnector.java:62)
at com.zoomdata.thrift.provider.BigTableTestConnector.main(BigTableTestConnector.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

Caused by: java.lang.NoSuchMethodError: sun.security.ssl.ClientHandshaker.getRawHostnameSE()Ljava/lang/String;
at sun.security.ssl.ClientHandshaker.getKickstartMessage(ClientHandshaker.java:1294)
at sun.security.ssl.Handshaker.kickstart(Handshaker.java:1014)
at sun.security.ssl.SSLSocketImpl.kickstartHandshake(SSLSocketImpl.java:1475)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at com.google.bigtable.repackaged.com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:77)
at com.google.bigtable.repackaged.com.google.api.client.http.HttpRequest.execute(HttpRequest.java:965)
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:222)
at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:76)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:53)
at io.grpc.auth.ClientAuthInterceptor$1.checkedStart(ClientAuthInterceptor.java:82)
at io.grpc.ClientInterceptors$CheckedForwardingCall.start(ClientInterceptors.java:185)
at io.grpc.stub.Calls.asyncServerStreamingCall(Calls.java:174)
at io.grpc.stub.Calls.unaryFutureCall(Calls.java:86)
at io.grpc.stub.Calls.blockingUnaryCall(Calls.java:129)
at com.google.bigtable.admin.table.v1.BigtableTableServiceGrpc$BigtableTableServiceBlockingStub.createTable(BigtableTableServiceGrpc.java:332)
at com.google.cloud.bigtable.grpc.BigtableAdminGrpcClient.createTable(BigtableAdminGrpcClient.java:78)
at org.apache.hadoop.hbase.client.BigtableAdmin.createTable(BigtableAdmin.java:304)
... 7 more

似乎 java 8 中的 sun 库发生了变化。是否有在 java 8 下运行此代码的解决方法?

4

2 回答 2

2

HBase 尚未通过 Java 8 的认证。暂时,坚持使用 Java 7。这里有两个 HBase / Hadoop 跟踪错误:

https://issues.apache.org/jira/browse/HADOOP-11090 https://issues.apache.org/jira/browse/HBASE-7608

于 2015-06-05T16:47:03.957 回答
0

在自己寻找答案时偶然发现了这一点。

我能够让它在我的引导类路径中使用正确版本的 ALPN。

对于 Java 8,我使用了 ALPN 版本8.1.4.v20150727

于 2015-08-17T21:31:33.590 回答