NoClassDefFoundError: com/google/api/client/util/Lists when setting up oauth2 on app engine

邮差的信 提交于 2020-01-06 13:52:41

问题


We're using the following libraries:

    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-bigquery</artifactId>
      <version>v2-rev114-1.17.0-rc</version>
    </dependency>

    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-drive</artifactId>
        <version>v2-rev98-1.17.0-rc</version>
    </dependency>

    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-oauth2</artifactId>
        <version>v2-rev50-1.17.0-rc</version>
    </dependency>

    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-jackson2</artifactId>
        <version>1.13.1-beta</version>
    </dependency>

    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client-appengine</artifactId>
        <version>1.17.0-rc</version>
    </dependency>

However, we're getting the following errors:

java.lang.NoClassDefFoundError: com/google/api/client/util/Lists
at com.google.api.client.auth.oauth2.Credential$Builder.<init>(Credential.java:625)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential$Builder.<init>(GoogleCredential.java:356)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.<init>(GoogleCredential.java:193)
at com.xyz.getStoredCredentials(GoogleUserCredentialManager.java:155)

java.lang.NoClassDefFoundError: com/google/api/client/json/JsonObjectParser$Builder
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient$Builder.<init>(AbstractGoogleJsonClient.java:74)
at com.google.api.services.bigquery.Bigquery$Builder.<init>(Bigquery.java:2913)
at com.abc.doPost(BigQuery.java:138)

So which libraries are we missing here?


回答1:


this change fixed it:

    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-jackson2</artifactId>
        <version>1.17.0-rc</version>
    </dependency>


来源:https://stackoverflow.com/questions/18817564/noclassdeffounderror-com-google-api-client-util-lists-when-setting-up-oauth2-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!