powered by Jive Software

404 joining my own GroupChat - Wildfire 2.5.1 and Smack 2.2.0

Hi,

I’'m using Wildfire 2.5.1 and Smack 2.2.0 with JDK1.5.0_06 on WinXP. I can never seem to be able to join the GroupChat that I am able to create. Any help would be appreciated.

The code:


import org.jivesoftware.smack.*;

import org.jivesoftware.smack.packet.*;

import java.util.Iterator;

public class Test extends Thread {

private static final int PORT = 5222;

private static final String HOSTNAME = “myhostname”;

private static final String ROOM = “testroom@” + HOSTNAME;

public Test() throws Exception {

SmackConfiguration.setPacketReplyTimeout(20000);

XMPPConnection mConnection = new XMPPConnection(HOSTNAME, PORT);

try {

AccountManager mAccountManager = mConnection.getAccountManager();

mAccountManager.createAccount(“master”, “master”);

} catch (XMPPException xmppe) {

if (xmppe.getXMPPError().getCode() != 409) {

throw xmppe;

}

}

mConnection.login(“master”, “master”);

GroupChat mChat = mConnection.createGroupChat(ROOM);

while (!mChat.isJoined()) {

try {

System.out.println(“Attempting to join…”);

mChat.join(“master”, 10000);

} catch (Exception ignored) { }

}

}

public static void main(String[] args) throws Exception {

new Test();

}

}

/pre

What is received from server in debug:


/pre

Hi Keith,

with group chat you mean MUC / conferencing? I took only a very short look on your code so please excuse me if I’'m wrong. If you do then you should use[code]

ROOM = “testroom@conference.” + HOSTNAME;[/code]

LG

Actually, I thought I would just start “easy” and try a org.jivesoftware.smack.GroupChat instance rather than a org.jivesoftware.smackx.muc.MultiUserChat instance. Basically, I’'m doing this:

GroupChat mChat = mConnection.createGroupChat(“testroom@myhostname”);

/pre

According to the XMPPConnection javadocs:

public GroupChat createGroupChat(String room)

Creates a new group chat connected to the specified room. The room name should be full address, such as room@chat.example.com.

/pre

The groupchat room creation appears to happen without error. It’'s the join of this room that returns a 404:

mChat.join(“master”, 10000);

/pre

Thanks,

Keith

Hi,

room@chat.example.com

where chat is the name of the conferencing service, using a Wifi default installation it is conference and not chat.

LG