0
在我的GAE應用程序有以下行:谷歌應用程序添加聯繫人錯誤?
ContactsService myService=new ContactsService("app-name");
它編譯罰款,但在運行時,它會導致以下錯誤:
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.Iterators.forArray([Ljava/lang/Object;)Lcom/google/common/collect/UnmodifiableIterator;
at com.google.common.collect.ImmutableSet$ArrayImmutableSet.iterator(ImmutableSet.java:415)
at com.google.common.collect.ImmutableSet$ArrayImmutableSet.iterator(ImmutableSet.java:392)
at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:317)
at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:601)
at com.google.gdata.wireformats.AltFormat.<init>(AltFormat.java:183)
at com.google.gdata.wireformats.AltFormat.<init>(AltFormat.java:42)
at com.google.gdata.wireformats.AltFormat$Builder.build(AltFormat.java:457)
at com.google.gdata.wireformats.AltFormat.<clinit>(AltFormat.java:49)
at com.google.gdata.client.Service.<clinit>(Service.java:558)
at Test.ContactsExample.<init>(ContactsExample.java:102)
我已經包括番石榴r09.jar,所以它有「ImmutableSet」,如果我不包含guava-r09.jar,它會說:
線程「main」中的異常java.lang.NoClassDefFoundError:com/google/common/collect/ImmutableSet
我該怎麼辦?