首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GAE远程应用编程接口: RemoteApiInstaller安装总是失败

GAE远程应用编程接口: RemoteApiInstaller安装总是失败
EN

Stack Overflow用户
提问于 2012-11-25 22:23:50
回答 2查看 563关注 0票数 0

GAE remote API for java:在App Engine客户端上配置远程应用编程接口

代码语言:javascript
复制
RemoteApiInsideAppEngineExample(String username, String password)
        throws IOException {
        // Authenticating with username and password is slow, so we'll do it
        // once during construction and then store the credentials for reuse.
        this.options = new RemoteApiOptions()
            .server("your_target_app_id.appspot.com", 443)
            .credentials(username, password);
        RemoteApiInstaller installer = new RemoteApiInstaller();
        installer.install(options);
        try {
            // Update the options with reusable credentials so we can skip
            // authentication on subsequent calls.
            options.reuseCredentials(username, installer.serializeCredentials());
        } finally {
            installer.uninstall();
        }
    }

在我的测试中,它总是抛出异常:

代码语言:javascript
复制
java.lang.IllegalArgumentException: charset may not be null or empty
    at com.google.appengine.repackaged.org.apache.commons.httpclient.util.EncodingUtil.getString(Unknown Source)
    at com.google.appengine.repackaged.org.apache.commons.httpclient.util.EncodingUtil.getString(Unknown Source)
    at com.google.appengine.tools.remoteapi.AppEngineClient$Response.getBodyAsString(AppEngineClient.java:138)
    at com.google.appengine.tools.remoteapi.RemoteApiInstaller.getAppIdFromServer(RemoteApiInstaller.java:318)
    at com.google.appengine.tools.remoteapi.RemoteApiInstaller.loginImpl(RemoteApiInstaller.java:278)
    at com.google.appengine.tools.remoteapi.RemoteApiInstaller.login(RemoteApiInstaller.java:239)
    at com.google.appengine.tools.remoteapi.RemoteApiInstaller.install(RemoteApiInstaller.java:106)

.

我确定用户名和密码是admin one,我使用的是GAE 1.7,联合登录,高复制数据存储。

有什么想法吗?谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-01-11 08:54:55

我想我找到了答案,我使用联合登录,而目前GAE远程API不支持联合登录-太糟糕了,我花了很多时间在调试上。

票数 0
EN

Stack Overflow用户

发布于 2013-01-08 18:46:01

代码在我身上起作用了。您只需要确保将"your_target_app_id"替换为applicationID

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13551883

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档