GAE xmpp app shows invalid JID error

落花浮王杯 提交于 2019-12-12 17:42:00

问题


Currently I'm testing appengine-crowdguru-python this app by sending xmpp messages from http://localhost:8000/xmpp which has a form to post data .. I have filled from, to, chat (message) fields.

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

where app-live app-id is currently on live. I also changed from and to fields to the ids like avi@xmpp.jp where this account is created through https://www.xmpp.jp/signup but it still shows invalid 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

回答1:


A common behaviour of "get Jid" it's error if Resource (in login phase) it's not definied due to the Jid composition ( user @ server /resource). A "full jid" it's complete of Resource, so if it's null you can have a null pointer and so an error.

How to handle: SOLUTION 1: retrive just "bare Jid"

SOLUTION 2: define a resource (it's a custom name that represent your client).

Hope that's help.



来源:https://stackoverflow.com/questions/37653184/gae-xmpp-app-shows-invalid-jid-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!