Hello,
I am using Smack 4.1.1 as Gradle dependency. I have successfully established connection with mine local OpenFire server.
But I have an issue while creating room from Android client.
final MultiUserChat multiUserChat = userChatManager.getMultiUserChat(roomId);
try {
multiUserChat.create(connection.getUser());
LOG.debug("room created");
} catch (XMPPException.XMPPErrorException | SmackException e) {
LOG.error("create room error:{}", e);
}
try{
multiUserChat.sendConfigurationForm(new Form(DataForm.Type.submit)); } catch (SmackException.NoResponseException | XMPPException.XMPPErrorException | SmackException.NotConnectedException e) {
LOG.error("sending room configurations error:{}", e);
}
The most great thing is that I can see that room was created in OpenFire admin panel and get room information from another client.
try {
MultiUserChatManager userChatManager = MultiUserChatManager.getInstanceFor(connection);
RoomInfo info = userChatManager.getRoomInfo(roomId);
LOG.debug("room has {} occupants", info.getOccupantsCount());
joinToExistingRoom(roomId);
} catch (XMPPException.XMPPErrorException e) {
LOG.error("join room error:{}", e);
final XMPPError.Condition condition = e.getXMPPError().getCondition();
if (condition == XMPPError.Condition.item_not_found) {
LOG.error("room does not exist error:{}", e);
createRoom(roomId);
}
}
But while trying to join room from second client I receive XMPPError: recipient-unavailable - wait.
Snippet of mine **joinRoom **method:
final MultiUserChat multiUserChat = userChatManager.getMultiUserChat(roomId);
try {
multiUserChat.join(connection.getUser());
LOG.debug("joined to room:{}", roomId);
} catch (SmackException.NoResponseException
| XMPPException.XMPPErrorException
| SmackException.NotConnectedException e) {
LOG.error("error joining room {}", e);
}
So I am catching** error joining room org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: recipient-unavailable - wait. **
So the question is what can be wrong?
I also tried creating submitForm from **createAnswerForm() **method. But the result is the same.
Maybe it is a simple problem, but now I do not know how to solve this issue.
Help will be appreciated a lot.
Thanks in advance.