After updating code to use the latest version of the google-cloud-storage
and google-cloud-bigquery
libraries (version 1.25.0) we are now throwing a NoSuchMethodError.
Exception in thread "main" java.lang.NoSuchMethodError: com.google.api.services.bigquery.model.JobReference.setLocation(Ljava/lang/String;)Lcom/google/api/services/bigquery/model/JobReference;
After doing some research it appears that is a dependency issue with the guava library. However, following the advice posted elsewhere (overriding the guava dependency) has not solved the issue, trying several guava versions.
Looking at the dependency tree it seems to me that the only place that the guava dependency appears is in the google-cloud libraries. Sometimes it requires version 20.0 and others 19.0. I've attached an excerpt of the tree that lead me to that conclusion.
├─ com.google.cloud:google-cloud-bigquery:1.25.0
│ ├─ com.google.auto.value:auto-value:1.4
│ ├─ com.google.cloud:google-cloud-core:1.25.0
│ │ ├─ com.google.api:api-common:1.5.0
│ │ │ ├─ com.google.code.findbugs:jsr305:3.0.0 -> 3.0.1
│ │ │ └─ com.google.guava:guava:19.0 -> 20.0
│ │ ├─ com.google.api:gax:1.23.0
│ │ │ ├─ com.google.api:api-common:1.5.0
│ │ │ │ ├─ com.google.code.findbugs:jsr305:3.0.0 -> 3.0.1
│ │ │ │ └─ com.google.guava:guava:19.0 -> 20.0
│ │ │ ├─ com.google.auth:google-auth-library-oauth2-http:0.9.0
│ │ │ │ ├─ com.google.auth:google-auth-library-credentials:0.9.0
│ │ │ │ ├─ com.google.guava:guava:19.0 -> 20.0
│ │ │ │ ├─ com.google.http-client:google-http-client:1.19.0 -> 1.23.0
│ │ │ │ │ ├─ com.google.code.findbugs:jsr305:1.3.9 -> 3.0.1
│ │ │ │ │ └─ org.apache.httpcomponents:httpclient:4.0.1 -> 4.3.6
│ │ │ │ │ ├─ commons-codec:commons-codec:1.6 -> 1.10
│ │ │ │ │ ├─ commons-logging:commons-logging:1.1.3
│ │ │ │ │ └─ org.apache.httpcomponents:httpcore:4.3.3
│ │ │ │ └─ com.google.http-client:google-http-client-jackson2:1.19.0 -> 1.23.0
│ │ │ │ ├─ com.fasterxml.jackson.core:jackson-core:2.1.3 -> 2.9.4
│ │ │ │ └─ com.google.http-client:google-http-client:1.23.0
│ │ │ │ ├─ com.google.code.findbugs:jsr305:1.3.9 -> 3.0.1
│ │ │ │ └─ org.apache.httpcomponents:httpclient:4.0.1 -> 4.3.6
│ │ │ │ ├─ commons-codec:commons-codec:1.6 -> 1.10
│ │ │ │ ├─ commons-logging:commons-logging:1.1.3
│ │ │ │ └─ org.apache.httpcomponents:httpcore:4.3.3
│ │ │ ├─ com.google.code.findbugs:jsr305:3.0.0 -> 3.0.1
│ │ │ ├─ com.google.guava:guava:20.0
│ │ │ └─ org.threeten:threetenbp:1.3.3
Could anyone offer any advice? I can't imagine we're the only ones to come across this issue.