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