0

Java用GAEリモートAPI:AppEngineクライアントでのリモートAPIの設定

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();
        }
    }

私のテストでは、常に例外をスローします。

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)

....。

ユーザー名とパスワードは管理者のものであると確信しています。GAE1.7、フェデレーションログイン、ハイレプリケーションデータストアを使用しています。

何か案は?ありがとう。

4

2 に答える 2

0

コードは私に働いていました。「your_target_app_id」をapplicationIDに置き換えることを確認する必要があります

于 2013-01-08T10:46:00.667 に答える
0

私は答えを見つけたと思います。私はフェデレーションログインを使用していますが、現在GAEリモートAPIはフェデレーションログインをサポートしていません---デバッグに多くの時間を費やしたほどひどいです。

于 2013-01-11T00:54:55.177 に答える