java - 如何解决此 PicasawebService 错误?

标签 java google-app-engine picasa

我只是想让一些事情发挥作用,这样我就可以尝试一些谷歌应用程序引擎java。然而我似乎有一些问题,我无法掌握。

java代码如下所示:

import java.net.URL;
import com.google.gdata.client.photos.*;
import com.google.gdata.data.photos.*;

public class TestPicasa {

public static void main(String[] args) {

    try {
        PicasawebService service = new PicasawebService("Picasa test");
        service.setUserCredentials("username@gmail.com", "password");
        URL feedURL = new URL("http://picasaweb.google.com/data/feed/api/user/username?kind=album");
        UserFeed feed = service.getFeed(feedURL, UserFeed.class);
        for (AlbumEntry entry : feed.getAlbumEntries()) {
             System.out.println(entry.getTitle().getPlainText());
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

}

}

我根据 google 的指示引用了 mail.jar、activation.jar、servlet-api.jar、gdata-client、gdata-client-meta、gdata-core、gdata-media、gdata-photos-2.0.jar 和 gdata-photos-meta-2.0.jar .

我在控制台收到此错误:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:118)
at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:100)
at com.google.gdata.client.Service.<clinit>(Service.java:532)
at TestPicasa.main(TestPicasa.java:10)

知道我错过了什么吗?

最佳答案

您还需要Google Collections

关于java - 如何解决此 PicasawebService 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1215644/

相关文章:

java - 定义一个实现可比较的接口(interface)

java - 每天哪里可以获得 1440 个免费的 cron 作业?

api - Picasa WEB API 仅返回 2400 个公共(public)相册中的 1000 个?

java - 从 JSF 中的数据表获取选定行数据

java - 如何获取文档字段的 TokenStream 以用于突出显示?

python - Google App Engine 的 PyDev 项目找不到 webapp2

python - 谷歌应用引擎 : Permalink generation

javascript - 更改 picasa 专辑封面图片

image - 是否有带有公共(public) API 的图像托管服务?

java - 使用 XPath 从 XML 获取元素值