我正在尝试运行Cloud Bigtable Hello World示例来说明与Google Bigtable的连接。
我执行该项目后构建正常
mvn package
我尝试使用以下命令运行示例...
mvn exec:java -Dbigtable.projectID=GCLOUDPROJECT -Dbigtable.instanceID=BIGTABLEINSTANCE
我用我的值替换了GCLOUDPROJECT和BIGTABLEINSTANCE。
maven构建产生以下输出...
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cloud-bigtable-hello-world 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ cloud-bigtable-hello-world ---
[WARNING]
java.lang.reflect.InvocationTargetException
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:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:294)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Could not find an appropriate constructor for com.google.cloud.bigtable.hbase1_x.BigtableConnection
at com.google.cloud.bigtable.hbase.BigtableConfiguration.connect(BigtableConfiguration.java:183)
at com.google.cloud.bigtable.hbase.BigtableConfiguration.connect(BigtableConfiguration.java:156)
at com.example.cloud.bigtable.helloworld.HelloWorld.doHelloWorld(HelloWorld.java:61)
at com.example.cloud.bigtable.helloworld.HelloWorld.main(HelloWorld.java:149)
... 6 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.google.cloud.bigtable.hbase.BigtableConfiguration.connect(BigtableConfiguration.java:180)
... 9 more
Caused by: java.lang.NoClassDefFoundError: io/grpc/Status$Code
at com.google.cloud.bigtable.config.RetryOptions.<clinit>(RetryOptions.java:52)
at com.google.cloud.bigtable.config.RetryOptions$Builder.<init>(RetryOptions.java:90)
at com.google.cloud.bigtable.config.BigtableOptions$Builder.<init>(BigtableOptions.java:95)
at com.google.cloud.bigtable.hbase.BigtableOptionsFactory.fromConfiguration(BigtableOptionsFactory.java:290)
at org.apache.hadoop.hbase.client.AbstractBigtableConnection.<init>(AbstractBigtableConnection.java:136)
at org.apache.hadoop.hbase.client.AbstractBigtableConnection.<init>(AbstractBigtableConnection.java:111)
at com.google.cloud.bigtable.hbase1_x.BigtableConnection.<init>(BigtableConnection.java:49)
... 14 more
Caused by: java.lang.ClassNotFoundException: io.grpc.Status$Code
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.142 s
[INFO] Finished at: 2018-12-13T13:48:18-05:00
[INFO] Final Memory: 10M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project cloud-bigtable-hello-world: An exception occured while executing the Java class. null: InvocationTargetException: Could not find an appropriate constructor for com.google.cloud.bigtable.hbase1_x.BigtableConnection: io/grpc/Status$Code: io.grpc.Status$Code -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
似乎缺少依赖项。
如何解决此问题?