Java GAE远程api:RemoteApiInstaller安装始终失败
:在应用程序引擎客户端上配置远程APIJava GAE远程api:RemoteApiInstaller安装始终失败,java,google-app-engine,Java,Google App Engine,:在应用程序引擎客户端上配置远程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 cre
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)
我确信用户名和密码是admin one,我使用GAE 1.7,联邦登录,高复制数据存储
有什么想法吗?
谢谢。代码对我有效。您只需确保您的应用程序id替换了“您的\u target\u app\u id”,我想我找到了答案,我使用了联邦登录,而当前GAE远程API不支持联邦登录,这太糟糕了,以至于我花了很多时间进行调试