Smack on Android, getting the error code = "404" the remote server is not found when sending packets / messages between two users through the local Openfire server

I was happy to implement smack on android through the local Openfire server, where it connects to the Gmail server server, and it works like a charm. The tutorial found here

But I get an error (inserted below) when I try to connect two users using Android emulators with a local Openfire server.

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 descriptions:

  • I am trying to connect two users with different usernames, email and passwords through two emulators in Android.
  • Both users show "Presence - Available" in the Openfire control panel when they are logged in. Presence presence = new Presence(Presence.Type.available);
  • From the error code inserted above the post id is the same, and I think there is no problem with that. (correct me if I am wrong)
  • I am using Packet Listener as indicated in the tutorial above code
  • I also tried using the chat manager while listening to the message using this code but not using it returns "Null"

Please help me, what is really wrong? If he could work with google talk, why not a local server? Or could it be due to the use of an emulator?

UPDATE 1:

To find out where the problem is! I downloaded the Spark client and did some testing. I found out that I can send packets / messages from Spark to Android Client, but not from Android to Spark, which gives me a 404 error! . Can someone still help me with at least some tips? you are welcome?

+4
source share
1 answer

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

+17
source

Source: https://habr.com/ru/post/1403063/


All Articles