Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smack on Android, getting error code="404" remote-server-not-found while sending packets/message between two users via local Openfire server

I was glad to implement smack on android via local Openfire server where it connects to Gmail server-host and it worked like charm. The tutorial found here

But I'm getting an error (pasted below) when I'm trying to connect two users via android emulators with a local Openfire server installed.

03-23 16:24:01.392: DEBUG/SMACK(233): 04:24:01 PM SENT (1155246128): <message id="t0tgA-5" to="justestingchat2" type="chat"><body>hi</body></message>
03-23 16:24:07.032: DEBUG/SMACK(233): 04:24:07 PM RCV  (1155246128): <message id="t0tgA-5" to="justestingchat@admin-pc/Smack" from="justestingchat2" type="error"><error code="404" type="cancel"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></message>
03-23 16:24:07.062: INFO/System.out(233): Received message: null

Here are some of my system level description:

  • I'm trying to connect two users with different user name, e-mail and passwords via two emulators in android.
  • Both the user show "Presence - Available" in the dashboard of Openfire when they are logged in Presence presence = new Presence(Presence.Type.available);
  • From the Error code pasted above the Message Id is same and i guess there is no problem with that. (correct me if I'm wrong)
  • I use the Packet Listener as provided in the tutorial above code
  • I also tried using chat manager in listening to the message using this code but no use it returned "Null"

Please can some one help me what's actually wrong? If it could work with google talk why not local server? Or is it may be because of using emulator?

UPDATE 1:

For finding out where the problem is! I downloaded Spark client and did some testing. I have found out that I'm able to send packets/messages from Spark to Android Client but not from Android to Spark, which gives me a Error 404! Can any one still help me with atleast some clues please?

like image 763
Wesley Avatar asked Dec 04 '22 04:12

Wesley


1 Answers

Your Android code is wrong. You are sending your message to a Jid which does not include the xmpp domain justestingchat2. Try to send your message to justestingchat2@admin-pc

like image 175
Alex Avatar answered Dec 05 '22 17:12

Alex