[英]IOException: unexpected response from remote api
I'm having exactly the same problem as this person: 我和这个人有完全相同的问题:
https://groups.google.com/forum/#!topic/google-appengine-java/4y90M9NlWsA https://groups.google.com/forum/#!topic/google-appengine-java/4y90M9NlWsA
but there are no responses and I can't see anything else on the internet that helps. 但是没有回复,我在互联网上看不到任何有帮助的东西。 Does anyone know why this would happen?
有谁知道为什么会这样?
RemoteApiOptions options = new RemoteApiOptions()
.server("localhost", 8888)
.credentials("blah@blah.blah", "");
RemoteApiInstaller installer = new RemoteApiInstaller();
installer.install(options);
The stacktrace is: 堆栈跟踪是:
Exception in thread "main" java.io.IOException: unexpected response from remote api: {rtok: null, app_id: MyCorrectAppId}
at com.google.appengine.tools.remoteapi.RemoteApiInstaller.getAppIdFromServer(RemoteApiInstaller.java:326)
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)
at uk.blah.blah.MyClass.main(MyClass.java:114)
I've noticed you've set the <application>
element inside appengine-web.xml to MyCorrectAppId
. 我注意到你已经将appengine-web.xml中的
<application>
元素设置为MyCorrectAppId
。 That's the problem. 那就是问题所在。 As Eugene rightly pointed out, the ID must be all lowercase , like
mycorrectappid
. 正如Eugene正确指出的那样, ID必须全部小写 ,就像
mycorrectappid
一样。 Quoting Dan Sanderson's book Programming Google App Engine : 引用Dan Sanderson的书“ 编程Google App Engine” :
Because the application ID is used in the domain name, an ID can contain only lowercase letters, numbers, or hyphens, and must be shorter than 32 characters.
由于域名中使用了应用程序ID,因此ID只能包含小写字母,数字或连字符,且必须短于32个字符。 Additionally, Google reserves every Gmail username as an application ID that only the corresponding Gmail user can register.
此外,Google会将每个Gmail用户名保留为只有相应Gmail用户才能注册的应用程序ID。
If you are working in Eclipse, you need to remember that when setting up a new web application project (there is an option towards the bottom of the "New Web Application Project" dialogue that allows you to specify the ID instead of leaving it blank). 如果您在Eclipse中工作,则需要记住在设置新的Web应用程序项目时(“新建Web应用程序项目”对话框底部有一个选项,允许您指定ID而不是将其留空) 。
For a standalone environment, I think you're probably fine if you leave the ID blank (it will default to "no_app_id"). 对于独立环境,如果您将ID留空(我将默认为“no_app_id”),我认为您可能没问题。
Hope that helps! 希望有所帮助!
According to the code of the RemoteApiInstaller.getAppIdFromServer
method the exception unexpected response from remote api
can be thrown when no app_id
property found in the response body. 根据
RemoteApiInstaller.getAppIdFromServer
方法的代码 ,当在响应正文中找不到app_id
属性时,可以抛出unexpected response from remote api
的异常unexpected response from remote api
。 And it seems that in your case it is probable that MyCorrectAppId
does not match the PAIR_REGEXP pattern, ie it contains any characters other than digits, letters in lower case, tilde, underscore or minus sign. 在您的情况下,似乎
MyCorrectAppId
可能与PAIR_REGEXP模式不匹配,即它包含除数字以外的任何字符,小写字母,波浪号,下划线或减号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.