[jdev] Smack API and jabber.org

jlist9 at gmail.com jlist9 at gmail.com
Thu Jan 8 15:30:00 CST 2009


Hello all,

Has anyone tried using jivesoftware's Smack API to access
jabber.org? I tried some sample code on their forum but I was
getting an error. The same code (with the slight difference of
using a full email address) works fine for talk.google.com.

Or, has anyone tried any java XMPP library with success?


The error:

SASL authentication failed using mechanism PLAIN:
        at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:325)
        at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395)
        at com.gn.xmpp.XmppTest.main(XmppTest.java:40)

The sample code:

ConnectionConfiguration cc = new ConnectionConfiguration("jabber.org", 5222, "jabber.org");
XMPPConnection connection = new XMPPConnection(cc);
try {
     connection.connect();
     SASLAuthentication.supportSASLMechanism("PLAIN", 0);
     connection.login("your.jabber", "password", "resource");
     System.out.println(connection.isAuthenticated());
} catch (XMPPException e1) {
     e1.printStackTrace();
}

-- 
Best regards,
Jack




More information about the JDev mailing list