【问题标题】:GAE xmpp app shows invalid JID errorGAE xmpp 应用程序显示无效的 JID 错误
【发布时间】:2016-10-05 19:27:26
【问题描述】:

目前我正在测试 appengine-crowdguru-python 这个应用程序,方法是从 http://localhost:8000/xmpp 发送 xmpp 消息,该消息有一个发布数据的表单。我已经填写了从、到、聊天(消息)字段。

From : avinash@app-live.appspotchat.com
To : ajin@app-live.appspotchat.com 
Chat: /tellme Who is Clinton?

app-live app-id 目前正在直播。我还将字段从和到更改为 avi@xmpp.jp 等 ID,该帐户是通过 https://www.xmpp.jp/signup 创建的,但它仍然显示无效的 JID..

ERROR    2016-06-06 08:45:32,157 wsgi.py:280] 
Traceback (most recent call last):
  File "/home/gemini/softwares/google_appengine/google/appengine/runtime/wsgi.py", line 268, in Handle
    result = handler(dict(self._environ), self._StartResponse)
  File "/home/gemini/softwares/google_appengine/lib/webapp2-2.3/webapp2.py", line 1519, in __call__
    response = self._internal_error(e)
  File "/home/gemini/softwares/google_appengine/lib/webapp2-2.3/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/home/gemini/softwares/google_appengine/lib/webapp2-2.3/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/home/gemini/softwares/google_appengine/lib/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/home/gemini/softwares/google_appengine/lib/webapp2-2.3/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/home/gemini/softwares/google_appengine/lib/webapp2-2.3/webapp2.py", line 547, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/home/gemini/softwares/google_appengine/google/appengine/ext/webapp/xmpp_handlers.py", line 63, in handle_exception
    super(BaseHandler, self).handle_exception(exception, debug_mode)
  File "/home/gemini/softwares/google_appengine/lib/webapp2-2.3/webapp2.py", line 545, in dispatch
    return method(*args, **kwargs)
  File "/home/gemini/PycharmProjects/appengine-crowdguru-python/guru.py", line 222, in post
    super(XmppHandler, self).post()
  File "/home/gemini/softwares/google_appengine/google/appengine/ext/webapp/xmpp_handlers.py", line 73, in post
    self.message_received(self.xmpp_message)
  File "/home/gemini/softwares/google_appengine/google/appengine/ext/webapp/xmpp_handlers.py", line 118, in message_received
    handler(message)
  File "/home/gemini/PycharmProjects/appengine-crowdguru-python/guru.py", line 302, in tellme_command
    message.reply(WAIT_MSG)
  File "/home/gemini/softwares/google_appengine/google/appengine/api/xmpp/__init__.py", line 515, in reply
    message_type=message_type, raw_xml=raw_xml)
  File "/home/gemini/softwares/google_appengine/google/appengine/api/xmpp/__init__.py", line 346, in send_message
    raise InvalidJidError()
InvalidJidError

【问题讨论】:

    标签: python google-app-engine xmpp


    【解决方案1】:

    “获取 Jid”的常见行为如果由于 Jid 组合(用户@服务器/资源)而未定义资源(在登录阶段),则它是错误的。一个“完整的 jid”它是完整的资源,所以如果它是空的,你可以有一个空指针和一个错误。

    如何处理: 解决方案 1:只检索“bare Jid”

    解决方案 2:定义资源(它是代表您的客户的自定义名称)。

    希望对您有所帮助。

    【讨论】:

    • 如何创建jid?我需要在 xmpp 客户端网站上创建一个帐户吗?
    • 等等。您在xmpp.jp 中创建了一个帐户,但您确定“app-live.appspotchat.com”正在“www.xmpp.jp”服务器中检索您的用户吗?按名称,它们似乎是 2 个不同的服务器,因此您收到的只是“用户不存在”消息;)
    • are you sure "app-live.appspotchat.com" is retriving your user in "www.xmpp.jp" server?我如何检查这个?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-25
    • 2018-12-07
    • 2021-12-06
    • 2011-03-31
    • 2020-03-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多