Я нашел решение, как подключиться к GTalk и Jabber.org с привкусом 3.1.0:
код для GTalk:
ConnectionConfiguration cc = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
XMPPConnection connection = new XMPPConnection(cc);
try {
connection.connect();
// You have to put this code before you login
SASLAuthentication.supportSASLMechanism("PLAIN", 0);
// You have to specify your gmail addres WITH @gmail.com at the end
connection.login("[email protected]", "password", "resource");
// See if you are authenticated
System.out.println(connection.isAuthenticated());
} catch (XMPPException e1) {
e1.printStackTrace();
}
Для Jabber.org Вот код:
ConnectionConfiguration cc = new ConnectionConfiguration("jabber.org", 5222, "jabber.org");
XMPPConnection connection = new XMPPConnection(cc);
try {
connection.connect();
// You have to put this code before you login
SASLAuthentication.supportSASLMechanism("PLAIN", 0);
// You have to specify your Jabber ID addres WITHOUT @jabber.org at the end
connection.login("your.jabber", "password", "resource");
// See if you are authenticated
System.out.println(connection.isAuthenticated());
} catch (XMPPException e1) {
e1.printStackTrace();
}
С помощью этого кода я могу подключиться к локальному серверу ejabberd и openfire. Надеюсь, это решит ваши проблемы.