0

我正在尝试测试此示例http://jclouds.apache.org/guides/filesystem/但我在线收到此错误:

BlobStoreContext context = ContextBuilder.newBuilder("filesystem")
                 .overrides(properties)
                 .buildView(BlobStoreContext.class);

错误:

13:39:23 ERROR main step.AbstractStep - Encountered an error executing the step
java.lang.NoClassDefFoundError: com/google/gson/TypeAdapter
    at org.jclouds.rest.config.RestModule.configure(RestModule.java:62)
    at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
    at com.google.inject.spi.Elements.getElements(Elements.java:101)
    at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
    at com.google.inject.Guice.createInjector(Guice.java:95)
    at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:403)
    at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:327)
    at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:618)
    at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:598)

谢谢!

4

1 回答 1

1

尝试将 Guava 从 14.0 升级到 15.0 以匹配 jclouds 对 Guava 的依赖。不要使用比 15.0 更新的版本,因为 jclouds 1.7.x 解决了 Java 7u51 和 Guava < 16.0.1 之间的不兼容问题,并且解决方法不支持更新的 Guava:

https://issues.apache.org/jira/browse/JCLOUDS-427

于 2014-05-23T00:53:14.467 回答