GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Error with gcloud-java for datastore access from compute engine: “LookupRequest overrides final method getUnknownFields” · Issue #681 · googleapis/google-cloud-java

Error with gcloud-java for datastore access from compute engine: “LookupRequest overrides final method getUnknownFields” #681

New issue
Copy link
New issue
Copy link
Closed
Closed
Error with gcloud-java for datastore access from compute engine: “LookupRequest overrides final method getUnknownFields”#681
Copy link
Assignees
unitydynamics

Description

@unitydynamics
unitydynamics
opened on Feb 28, 2016
Issue body actions

I started a brand new Java project (Java 8) and used maven to pull down my dependencies:

<dependency>
  <groupId>com.google.gcloud</groupId>
  <artifactId>gcloud-java</artifactId>
  <version>0.1.4</version>
</dependency>

I then wrote a very simple test call to write to the datastore... but there seems to be something structurally wrong with the library... here is the exception I ran into:

java.lang.VerifyError: class com.google.api.services.datastore.DatastoreV1$LookupRequest overrides final method getUnknownFields.

()Lcom/google/protob
uf/UnknownFieldSet;
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at com.google.gcloud.datastore.DatastoreOptions.normalize(DatastoreOptions.java:123)
        at com.google.gcloud.datastore.DatastoreOptions.access$400(DatastoreOptions.java:36)
        at com.google.gcloud.datastore.DatastoreOptions$Builder.build(DatastoreOptions.java:89)
        at com.google.gcloud.datastore.DatastoreOptions.defaultInstance(DatastoreOptions.java:175)

    ... my code here which called Datastore datastore = DatastoreOptions.defaultInstance().service();

I have plenty of jars but my environment is clean... I don't have any of the legacy google.appengine.* jars around. Just to make sure:

find . -name "*.jar" -exec grep -Hsli LookupRequest {} \;
returned only:

./google-api-services-datastore-protobuf-v1beta2-rev1-4.0.0.jar

Is the Google distribution broken? Is this a me thing? Any help appreciated.

Activity

Next
  1. aozarov commented on Feb 28, 2016

    @aozarov
    aozarov
    on Feb 28, 2016
    Contributor
    More actions

    Looks like you are pulling a version of com.google.protobuf:protofuf-java which is not compatible with the underlying datastore-protobuf dependency google-api-services-datastore-protobuf-v1beta2-rev1-4.0.0.

    Try running mvn dependency:tree -Dverbose -Dincludes=com.google.protobuf:protobuf-java to see
    where you are pulling it from and exclude it from there.

    A similar reported issue discovered that it was pulled from j2html and disabled it this way:

      <dependency>
         <groupId>com.j2html</groupId>
         <artifactId>j2html</artifactId>
         <version>0.7</version>
         <exclusions>
           <exclusion>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
           </exclusion>
           <exclusion>
             <groupId>com.google.protobuf</groupId>
             <artifactId>protobuf-java</artifactId>
           </exclusion>
         </exclusions>
       </dependency>

    /cc @eddavisson

  2. unitydynamics commented on Feb 29, 2016

    @unitydynamics
    unitydynamics
    on Feb 29, 2016
    Author
    More actions
    [WARNING] Using Maven 2 dependency tree to get verbose output, which may be inconsistent with actual Maven 3 resolution
    [INFO] .... my jar......
    [INFO] \- com.google.gcloud:gcloud-java:jar:0.1.4:compile
    [INFO]    \- com.google.gcloud:gcloud-java-datastore:jar:0.1.4:compile
    [INFO]       \- com.google.apis:google-api-services-datastore-protobuf:jar:v1beta2-rev1-4.0.0:compile
    [INFO]          +- com.google.protobuf:protobuf-java:jar:3.0.0-beta-1:compile
    [INFO]          \- com.google.http-client:google-http-client-protobuf:jar:1.15.0-rc:compile
    [INFO]             \- (com.google.protobuf:protobuf-java:jar:2.4.1:compile - omitted for conflict with 3.0.0-beta-1)
    

    Thanks for pointing me in the right direction.... I should have noticed that old version of http-client-protobuf was there. I moved that to 1.21 and deleted protobuf-java-2.4.1.jar and I'm off to the races now. Thank you @aozarov

    I immediately tested an now I'm getting "not authorized" type of error...

    Feb 29, 2016 1:08:06 PM com.google.api.services.datastore.client.BaseDatastoreFactory makeClient
    WARNING: Not using any credentials
    Feb 29, 2016 1:08:07 PM com.google.api.services.datastore.client.BaseDatastoreFactory makeClient
    WARNING: Not using any credentials
    com.google.gcloud.datastore.DatastoreException
            at com.google.gcloud.spi.DefaultDatastoreRpc.translate(DefaultDatastoreRpc.java:110)
            at com.google.gcloud.spi.DefaultDatastoreRpc.lookup(DefaultDatastoreRpc.java:147)
            at com.google.gcloud.datastore.DatastoreOptions.normalize(DatastoreOptions.java:128)
            at com.google.gcloud.datastore.DatastoreOptions.access$400(DatastoreOptions.java:36)
            at com.google.gcloud.datastore.DatastoreOptions$Builder.build(DatastoreOptions.java:89)
            at com.google.gcloud.datastore.DatastoreOptions.defaultInstance(DatastoreOptions.java:175)
            at com.industryopenings.seeker.driver.SiteLogger.saveEntry(SiteLogger.java:122)
            at com.industryopenings.seeker.driver.SiteLogger.log(SiteLogger.java:235)
            at com.industryopenings.seeker.driver.SiteLogger.log(SiteLogger.java:188)
            at com.industryopenings.seeker.driver.SiteLogger.info(SiteLogger.java:273)
            at com.industryopenings.seeker.driver.Driver.main(Driver.java:61)
    Caused by: com.google.api.services.datastore.client.DatastoreException
            at com.google.api.services.datastore.client.RemoteRpc.makeException(RemoteRpc.java:115)
            at com.google.api.services.datastore.client.RemoteRpc.call(RemoteRpc.java:81)
            at com.google.api.services.datastore.client.BaseDatastoreFactory$RemoteRpc.call(BaseDatastoreFactory.java:41)
            at com.google.api.services.datastore.client.Datastore.lookup(Datastore.java:93)
            at com.google.gcloud.spi.DefaultDatastoreRpc.lookup(DefaultDatastoreRpc.java:145)
            ... 9 more
    Caused by: com.google.api.client.http.HttpResponseException: 401 Unauthorized
            at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1061)
            at com.google.api.services.datastore.client.RemoteRpc.call(RemoteRpc.java:78)
            ... 12 more
    
    

    If I can bug you just one more time... what's the magic I need to add to authenticate? Perhaps I read the docs too quickly... I thought it was handled automatically. My compute engine instances is in the same project... but inspection of the environment variables doesn't seem to yield anything that would tip off gcloud-java what my project ID is.

    I'm almost there!

    Oh and I built my custom image from the standard image: debian-8-jessie-v20160219
    ... and here is the permissions section on my instance. I haven't tried with "Allow All" option yet... maybe I'll test that.

    image

  3. mziccard commented on Feb 29, 2016

    @mziccard
    mziccard
    on Feb 29, 2016
    Contributor
    More actions

    @unitydynamics glad you solved your original issue.

    For the 401 Unauthorized error try also adding the "User Info" scope (the first permission in your screenshot) when you create the instance.

  4. unitydynamics commented on Feb 29, 2016

    @unitydynamics
    unitydynamics
    on Feb 29, 2016
    Author
    More actions

    You nailed it @mziccard . I've written my first entity to the datastore with gcloud-java! Thanks.

    I noticed the required permissions are indeed documented...: https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/authentication/readme.md#authentication

    but... I'm probably not the last wandering spirit to trip over this... gentle recommendation to clean up the scopes.

  5. unitydynamics commented on Feb 29, 2016

    @unitydynamics
    unitydynamics
    on Feb 29, 2016
    Author
    More actions

    On more small comment... Stderr is getting littered with plenty of:
    Feb 29, 2016 3:14:07 PM com.google.api.services.datastore.client.BaseDatastoreFactory makeClient
    WARNING: Not using any credentials

  6. aozarov commented on Feb 29, 2016

    @aozarov
    aozarov
    on Feb 29, 2016
    Contributor
    More actions

    @unitydynamics You can safely ignore this WARNING. It will be gone in the next version of the datastore
    (v1beta3). Also, the need to use "User Info" scope is going to be removed by then.

  7. unitydynamics
    closed this as completedon Mar 1, 2016
  8. JustinBeckwith
    assigned
    unitydynamics
    on Feb 1, 2021
  9. github-actions
    added 5 commits that reference this issue on Jun 23, 2022

    feat: Enable REST transport for most of Java and Go clients (#681)

    7917b3f

    chore: release 1.2.1 (googleapis#681)

    81ef316

    chore: update dependencies for regapic (googleapis#1467) (googleapis#681

    9f28900

    chore: update dependencies for regapic (googleapis#1467) (googleapis#681

    ef11bf8

    chore(main): release 2.4.0 (googleapis#686)

    bd8a09c
  10. github-actions
    added 2 commits that reference this issue on Jul 14, 2022

    chore: fix minor typos in README and pom templates (#1479) (#681)

    8d3a2bf

    chore(deps): update dependency com.google.cloud:libraries-bom to v26 (#…

    0e42817
  11. 2 remaining items

  12. suztomo
    added a commit that references this issue on Feb 1, 2023

    build(deps): update dependency com.google.cloud:google-cloud-shared-c…

    ce23b5a
  13. meltsufin
    added 2 commits that reference this issue on Dec 22, 2025

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    9be4047

    chore: release 3.2.0 (#695)

    a4f9f05
  14. chingor13
    added 2 commits that reference this issue on Jan 6, 2026

    deps: update dependency org.slf4j:slf4j-api to v1.7.36 (#681)

    bd4c4da

    chore(main): release 0.124.0 (#770)

    b5bf336
  15. chingor13
    added a commit that references this issue on Jan 22, 2026

    chore(main): release 2.2.9 (#681)

    9e80bc2
  16. chingor13
    added a commit that references this issue on Feb 24, 2026

    chore(deps): update dependency org.apache.maven.plugins:maven-javadoc…

    65d28e3
  17. suztomo
    added 2 commits that reference this issue on Mar 11, 2026

    deps: update dependency com.google.cloud:google-cloud-shared-dependen…

    9ada3b2

    chore: release 3.2.0 (googleapis#695)

    2aad039
  18. chingor13
    added a commit that references this issue on Mar 12, 2026

    chore(deps): update dependency org.apache.maven.plugins:maven-javadoc…

    9d8b528
  19. suztomo
    added a commit that references this issue on Mar 30, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-nio to v…

    120203b
  20. lqiu96
    added a commit that references this issue on Apr 1, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-nio to v…

    a4cb1c9
  21. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    test(deps): update dependency com.google.truth:truth to v1.1.3 (#681)

    a4ea6fa

    test(deps): update dependency com.google.truth:truth to v1.1.3 (#681)

    2d26ea0
  22. benjaminp
    added a commit that references this issue on Jul 13, 2026

    chore: regenerate README (googleapis#681)

    ba2b5dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @unitydynamics
    unitydynamics

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.