Hi everyone, I work on a XMPP client but when I want to use MUC I have an issue.
I create a room and invite an another client but, when he try to join the room I have “XMPPError: item-not-found - cancel”.
I do for join :
muc.join(nickname);
when I print my MUC there is : “MUC: aze@conference.b105783.ww930.my-it-solutions.net (test1@b105783.ww930.my-it-solutions.net /51zu4e91ib)”
the entire error :
Erreur join chat : org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPP error reply received from aze@conference.domaine.net /aze: XMPPError: item-not-found - cancel
For the moment try to join a muc with the return of Listener and with the name chat, and I get the same thing, I don’t understand why.
The function who is call when Listener handle an event :
public void joinChatWithoutPass(MultiUserChat muc) throws Exception{
System.out.println(“join Chat”);
try {
muc.join(Resourcepart.from(“aze”));
}catch(Exception e){
System.out.println("Erreur join chat : "+e);
}
}
Regards
Hi everyone,
I don’t know why, but now it’s work, I just extends my connection class with XMPPTCPconnection, I hope that can help.
Hi, my problem is come back, but now I know when he come. When I try to join a room by myself I have no problem.
public void joinSpecificChat(String roomName, XMPPTCPConnection connection){
try {
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
EntityBareJid mucJid = JidCreate.entityBareFrom(roomName+"@conference ."+host);
MultiUserChat muc = manager.getMultiUserChat(mucJid);
muc.join(Resourcepart.from(userName));
}catch(Exception e){
System.out.println(“echec pour rejoindre le cannal”);
e.printStackTrace();
}
}
But, when I join after Listener handle and invitation I have Item Not Found
manager.getInstanceFor(connection).addInvitationListener(new InvitationListener() {
public void invitationReceived(XMPPConnection xmppConnection, MultiUserChat multiUserChat, EntityJid entityJid, String s, String s1, Message message, MUCUser.Invite invite) {
System.out.println("///////////////////////////////////////////////////////////");
System.out.println("Listen - “+s1+” - "+s);
try {
joinChatWithoutPass(multiUserChat);
} catch (Exception e) {
e.printStackTrace();
}
}
});
public void joinChatWithoutPass(MultiUserChat room) throws Exception{
try {
room.join(Resourcepart.from(userName));
}catch(Exception e){
System.out.println(“echec pour rejoindre le cannal”);
e.printStackTrace();
}
}
I try to do the same than joinSpecificChat but that change nothing.
The complete Trace :13:52:48 RECV (0): <iq type=“result” id=“YAu2r-13” from="conference.b105783.ww93 - Pastebin.com
Flow
June 2, 2017, 5:05pm
7
<presence … id=“YAu2r-18” from="aze@conference.b105783.ww930.my-it-solutions.net /test1@b105783.ww930.my-it-solutions.net/6p1a885qnm" type=“error”>
I think you are trying to join the wrong MUC. I believe instead of
aze@conference.b105783.ww930.my-it-solutions.net /test1@b105783.ww930.my-it-solutions.net/6p1a885qnm
you want to join
aze@conference.b105783.ww930.my-it-solutions.net /6p1a885qnm
So your userName field is likely wrong.
Hi,
I check if there was difference in trace when it work but they seems similar :
//Case when it work 08:37:45 SENT (0): <presence to='azerty@conference.b105783. - Pastebin.com
For join the chat with the listener I take the MUC who was send and I just do muc.join(“nickname”).
manager.getInstanceFor(connection).addInvitationListener(new InvitationListener() {
public void invitationReceived(XMPPConnection xmppConnection, MultiUserChat multiUserChat, EntityJid entityJid, String s, String s1, Message message, MUCUser.Invite invite) {
System.out.println("///////////////////////////////////////////////////////////");
System.out.println("Listen - “+s1+” - "+s);
manager = MultiUserChatManager.getInstanceFor(xmppConnection);
MultiUserChat muc = manager.getMultiUserChat(multiUserChat.getRoom());
try {
userName = “test11”;
muc.join(Resourcepart.from(userName));
} catch (Exception e) {
e.printStackTrace();
}
}
});
I was test a thing, I launch the same join function with two different method.
public void joinSpecificChat(String roomName, XMPPTCPConnection connection){
try {
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(this.connection);
EntityBareJid mucJid = JidCreate.entityBareFrom(“aaa”+"@conference ."+host);
System.out.println(“aaa”+"@conference ."+host);
MultiUserChat muc = manager.getMultiUserChat(mucJid);
muc.join(Resourcepart.from(userName));
}catch(Exception e){
System.out.println(“echec pour rejoindre le cannal”);
e.printStackTrace();
}
}
This function is completely autonomous but when I start with a button event JavaFx I can join without problem. When I try to start with the listener that fail.
Kelkun
June 6, 2017, 12:06pm
10
Hi, I’m back.
I did lot of test with a client XMPP free and I have a better Idea where is my problem. It seems it come from the creation of the room, or the invitation. When I find the problem I come back here.
Kelkun
June 7, 2017, 7:28am
11
Hi, I’m back !!!
Ok, I find a solution for my problem. I try to do the same with Persistant chat and that’s work fine. I don’t now why but with temporarly chat my invitation didn’t work.