Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigTable API - Error connecting to BigTable Emulator #2200

Open
spachari-im opened this issue Apr 13, 2024 · 0 comments
Open

BigTable API - Error connecting to BigTable Emulator #2200

spachari-im opened this issue Apr 13, 2024 · 0 comments
Labels
api: bigtable Issues related to the googleapis/java-bigtable API.

Comments

@spachari-im
Copy link

Can you please help me identify why BigTable API fails to connect with BigTable emulator running on Docker?

Environment details

  1. Specify the API at the beginning of the title - BigTable
  2. OS type and version: Mac
  3. Java version: 17
  4. bigtable version(s): Docker BigTable

Steps to reproduce

  1. Start gcloud BigTable emulator in local Docker.
  2. Run the basic Read example - https://github.com/googleapis/java-bigtable/blob/main/samples/snippets/src/main/java/com/example/bigtable/Reads.java

Code example

    <dependencyManagement>
        <dependencies>
           <dependency>
                <groupId>com.google.cloud</groupId>
                <artifactId>libraries-bom</artifactId>
                <version>26.37.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
         ......
        </dependencies>
    </dependencyManagement>
.....
<dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-bigtable</artifactId>
        </dependency>
try (BigtableTableAdminClient adminClient =
                 BigtableTableAdminClient.create(projectId, instanceId)) {
            CreateTableRequest createTableRequest =
                CreateTableRequest.of(tableId)
                                  .addFamily(COLUMN_FAMILY_NAME_STATS)
                                  .addFamily(COLUMN_FAMILY_NAME_PLAN);
            adminClient.createTable(createTableRequest);
        } catch (IOException e) {
            System.out.println("Error during createTable: \n" + e.toString());
            throw (e);
        }

Stack trace

INFO: Connecting to the Bigtable emulator at localhost:8086
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Verify
	at com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings.<init>(BigtableTableAdminSettings.java:66)
	at com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings.<init>(BigtableTableAdminSettings.java:53)
	at com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings$Builder.build(BigtableTableAdminSettings.java:265)
	at com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient.create(BigtableTableAdminClient.java:151)
	at com.thinknear.venice.dao.gcp.BigTableClientTest.createTable(BigTableClientTest.java:63)
	at com.thinknear.venice.dao.gcp.BigTableClientTest.main(BigTableClientTest.java:39)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Verify
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 6 more

External references such as API reference guides

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/java-bigtable API. label Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/java-bigtable API.
Projects
None yet
Development

No branches or pull requests

1 participant