Google App添加联系人错误? [英] Google App add contact error?

查看:60
本文介绍了Google App添加联系人错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的GAE应用程序中,有以下一行:

In my GAE app there is the following line :

ContactsService myService=new ContactsService("app-name");

它编译正常,但是运行时会导致以下错误:

It compiled fine, but when run, it cause the following error :

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)

我已经包含了guava-r09.jar,所以它具有"ImmutableSet",如果我不包含guava-r09.jar,它将说:

I've included guava-r09.jar, so it has the "ImmutableSet", if I don't included guava-r09.jar, it will say :

线程"main"中的异常java.lang.NoClassDefFoundError:com/google/common/collect/ImmutableSet

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableSet

我该怎么办?

推荐答案

我发现了原因:不需要包括google-collect-*.jar(错误源).

I found out why : don't need to include google-collect-*.jar, source of error.

这篇关于Google App添加联系人错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆