这是我的问题堆栈跟踪:-
SEVERE: Unhandled exception
java.lang.NoSuchMethodError: io.opencensus.trace.Span.addMessageEvent(Lio/opencensus/trace/MessageEvent;)V
at com.google.api.client.http.OpenCensusUtils.recordMessageEvent(OpenCensusUtils.java:222)
at com.google.api.client.http.OpenCensusUtils.recordSentMessageEvent(OpenCensusUtils.java:190)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:994)
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:429)
at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:157)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:145)
at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:91)
at com.google.cloud.http.HttpTransportOptions$1.initialize(HttpTransportOptions.java:159)
at com.google.cloud.http.CensusHttpModule$CensusHttpRequestInitializer.initialize(CensusHttpModule.java:109)
at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:88)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:300)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.google.cloud.storage.spi.v1.HttpStorageRpc.get(HttpStorageRpc.java:436)
at com.google.cloud.storage.StorageImpl$5.call(StorageImpl.java:244)
at com.google.cloud.storage.StorageImpl$5.call(StorageImpl.java:241)
at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
at com.google.cloud.storage.StorageImpl.get(StorageImpl.java:240)
at com.google.cloud.storage.StorageImpl.get(StorageImpl.java:258)
这是我的依赖树:-
+- com.google.apis:google-api-services-compute:jar:beta-rev91-1.23.0:compile
[INFO] | \- com.google.api-client:google-api-client:jar:1.23.0:compile
[INFO] | +- com.google.oauth-client:google-oauth-client:jar:1.23.0:compile
[INFO] | \- com.google.http-client:google-http-client-jackson2:jar:1.23.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.1.3:compile
[INFO] +- com.infiverve.flint.sdk:flint-sdk:jar:5.0.0.0:provided
[INFO] +- com.google.guava:guava:jar:28.1-jre:compile
[INFO] | +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] | +- org.checkerframework:checker-qual:jar:2.8.1:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.3.2:compile
[INFO] | +- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.18:compile
[INFO] \- com.google.cloud:google-cloud-storage:jar:1.102.0:compile
[INFO] +- com.google.cloud:google-cloud-core-http:jar:1.91.3:compile
[INFO] | +- com.google.cloud:google-cloud-core:jar:1.91.3:compile
[INFO] | | +- com.google.protobuf:protobuf-java-util:jar:3.10.0:compile
[INFO] | | +- com.google.api.grpc:proto-google-common-protos:jar:1.17.0:compile
[INFO] | | +- com.google.api.grpc:proto-google-iam-v1:jar:0.13.0:compile
[INFO] | | +- org.threeten:threetenbp:jar:1.3.3:compile
[INFO] | | \- com.google.protobuf:protobuf-java:jar:3.10.0:compile
[INFO] | +- com.google.auth:google-auth-library-credentials:jar:0.18.0:compile
[INFO] | +- com.google.auth:google-auth-library-oauth2-http:jar:0.18.0:compile
[INFO] | | \- com.google.auto.value:auto-value-annotations:jar:1.6.6:compile
[INFO] | +- com.google.http-client:google-http-client:jar:1.32.1:compile
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.10:compile
[INFO] | | | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | | | \- commons-codec:commons-codec:jar:1.11:compile
[INFO] | | \- org.apache.httpcomponents:httpcore:jar:4.4.12:compile
[INFO] | +- com.google.http-client:google-http-client-appengine:jar:1.32.1:compile
[INFO] | +- com.google.api:gax:jar:1.49.1:compile
[INFO] | +- com.google.api:gax-httpjson:jar:0.66.1:compile
[INFO] | | \- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] | +- io.opencensus:opencensus-api:jar:0.24.0:compile
[INFO] | | \- io.grpc:grpc-context:jar:1.22.1:compile
[INFO] | +- io.opencensus:opencensus-contrib-http-util:jar:0.24.0:compile
[INFO] | \- com.google.api:api-common:jar:1.8.1:compile
[INFO] | \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] \- com.google.apis:google-api-services-storage:jar:v1-rev20190910-1.30.3:compile
我在这行代码中遇到了这个问题:-
Storage storage = StorageOptions.newBuilder()
.setCredentials(ServiceAccountCredentials.fromStream(credentialsInputStream))
.setProjectId(flintRequestProjectID)
.build().getService();
Blob blob = storage.get(BlobId.of(billingBucketName, billingFileName)); <- (!!THis line of code!!)
我已经尝试过我发现的关于这个问题的修复(下面提供的链接),但它没有奏效。 链接到我在 github 上找到并尝试过的修复程序