Google Cloud Bigtable Java客户端-技术错误 [英] Google Cloud Bigtable Java Client - tcnative errors

查看:168
本文介绍了Google Cloud Bigtable Java客户端-技术错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接到Cloud Bigtable;但是,我遇到了找不到netty-tcnative的问题.

I am trying to connect to Cloud Bigtable; however, I'm getting issues with netty-tcnative not being found.

Maven依赖项:

<dependency>
    <groupId>com.google.cloud.bigtable</groupId>
    <artifactId>bigtable-hbase-1.2</artifactId>
    <version>0.9.2</version>
</dependency>

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-tcnative-boringssl-static</artifactId>
    <version>1.1.33.Fork19</version>
</dependency>

错误输出:

ERROR 2016-09-09 22:26:00,969 [main] com.google.cloud.bigtable.grpc.BigtableSession: Neither Jetty ALPN nor OpenSSL are available. OpenSSL unavailability cause:
java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty-tcnative-osx-x86_64, netty-tcnative]    
Exception in thread "BigtableSession-startup-2" java.lang.ExceptionInInitializerError
at com.google.cloud.bigtable.grpc.BigtableSession$3.run(BigtableSession.java:194)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:634)
at java.util.zip.ZipFile.getEntry(ZipFile.java:305)
at java.util.jar.JarFile.getEntry(JarFile.java:227)
at java.util.jar.JarFile.getJarEntry(JarFile.java:210)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:840)
at sun.misc.URLClassPath.getResource(URLClassPath.java:199)
at java.net.URLClassLoader$1.run(URLClassLoader.java:358)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.mule.module.launcher.FineGrainedControlClassLoader.findClass(FineGrainedControlClassLoader.java:175)
at org.mule.module.launcher.MuleApplicationClassLoader.findClass(MuleApplicationClassLoader.java:134)
at org.mule.module.launcher.FineGrainedControlClassLoader.loadClass(FineGrainedControlClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.google.bigtable.repackaged.io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:36)
at com.google.bigtable.repackaged.io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
at com.google.bigtable.repackaged.io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47)
at com.google.bigtable.repackaged.io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:58)
at com.google.bigtable.repackaged.io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:77)
at com.google.bigtable.repackaged.io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:72)
at com.google.bigtable.repackaged.io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:59)
at com.google.cloud.bigtable.grpc.BigtableSessionSharedThreadPools.init(BigtableSessionSharedThreadPools.java:85)
at com.google.cloud.bigtable.grpc.BigtableSessionSharedThreadPools.<init>(BigtableSessionSharedThreadPools.java:77)
at com.google.cloud.bigtable.grpc.BigtableSessionSharedThreadPools.<clinit>(BigtableSessionSharedThreadPools.java:45)
... 4 more
Exception in thread "BigtableSession-startup-1" java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:634)
at java.util.zip.ZipFile.getEntry(ZipFile.java:305)
at java.util.jar.JarFile.getEntry(JarFile.java:227)
at java.util.jar.JarFile.getJarEntry(JarFile.java:210)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:840)
at sun.misc.URLClassPath.getResource(URLClassPath.java:199)
at java.net.URLClassLoader$1.run(URLClassLoader.java:358)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.mule.module.launcher.FineGrainedControlClassLoader.findClass(FineGrainedControlClassLoader.java:175)
at org.mule.module.launcher.MuleApplicationClassLoader.findClass(MuleApplicationClassLoader.java:134)
at org.mule.module.launcher.FineGrainedControlClassLoader.loadClass(FineGrainedControlClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.google.bigtable.repackaged.com.google.api.client.http.javanet.NetHttpTransport$Builder.trustCertificates(NetHttpTransport.java:270)
at com.google.bigtable.repackaged.com.google.api.client.googleapis.javanet.GoogleNetHttpTransport.newTrustedTransport(GoogleNetHttpTransport.java:55)
at com.google.cloud.bigtable.config.CredentialFactory.getHttpTransport(CredentialFactory.java:94)
at com.google.cloud.bigtable.grpc.BigtableSession$2.run(BigtableSession.java:183)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

推荐答案

此问题归因于Mule的类加载器. Mule在自己的类加载器中运行每个应用程序.需要将其移至Mule的通用类加载器(java.class.path),而不是应用程序类加载器.确保BigTable客户端库和tcnative都在同一类路径中.

This issue was due to Mule's class loader. Mule runs each app in its own class loader. Need to move this to Mule's common class loader (java.class.path), rather than the app class loader. Ensuring both BigTable client library and tcnative is in the same classpath.

此问题将在其他容器(例如Tomcat)中出现,因为它们遵循类似的类加载器模式.

This issue would arise in other containers such as Tomcat, as they follow similar class loader patterns.

这篇关于Google Cloud Bigtable Java客户端-技术错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆