gpt4 book ai didi

google-app-engine - GCS 客户端库 NoSuchMethod systemNanoTime

转载 作者:太空宇宙 更新时间:2023-11-03 15:35:27 25 4
gpt4 key购买 nike

当我调用 createOrReplace 时,

private GcsService gcsService = 
GcsOutputChannel outputChannel = gcsService.createOrReplace(file, GcsFileOptions.getDefaultInstance());

我明白了

java.lang.NoSuchMethodError: com.google.common.base.Platform.systemNanoTime()J
at com.google.common.base.Ticker$1.read(Ticker.java:60)
at com.google.common.base.Stopwatch.start(Stopwatch.java:114)
at com.google.appengine.tools.cloudstorage.RetryHelper.doRetry(RetryHelper.java:88)
at com.google.appengine.tools.cloudstorage.RetryHelper.runWithRetries(RetryHelper.java:138)
at com.google.appengine.tools.cloudstorage.GcsServiceImpl.createOrReplace(GcsServiceImpl.java:47)
at com.train.trainercircle.rest.ImageResource.getExercises(ImageResource.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:45)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at

我查看了 elipse 中的 pom 文件依赖管理器,并确保编译了 gcs-client 库所需的 guava 版本。

有什么建议,有什么想法吗?

谢谢

最佳答案

按照建议here您的类路径中可能有一个 google-collections jar 以及 Guava。确保将其删除。如果使用 Maven

<exclusions>
<exclusion>
<artifactId>google-collect</artifactId>
<groupId>com.google</groupId>
</exclusion>
</exclusions>

另见 here

Guava is a fully compatible superset of the old Google Collections Library. It also includes years worth of bug fixes, doc fixes, and performance fixes, so we strongly encourage you to use Guava instead of Google Collections.

If your application ever ends up with both google-collect-1.0.jar and guava-r##.jar on the same classpath, simply remove the Google Collections JAR and you should be fine. If you don't remove it, it will either cause terrible problems (if it comes before guava in the classpath) or will never even be seen anyway (if it comes after).

关于google-app-engine - GCS 客户端库 NoSuchMethod systemNanoTime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17690841/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com