Unable to connect to google talk with smack 3.0

Today I upgraded from smack 2.1 to 3.0, and I noticed (sadly) that the GoogleTalkConnection used to simplify the connection to google talk is not anymore there… well, I replaced it with the following code:

ConnectionConfiguration config = new ConnectionConfiguration(“talk.google.com”, 5222);

config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);

config.setDebuggerEnabled(true);

config.setExpiredCertificatesCheckEnabled(false);

config.setNotMatchingDomainCheckEnabled(false);

config.setSelfSignedCertificateEnabled(true);

config.setVerifyRootCAEnabled(false);

XMPPConnection con = new XMPPConnection(config);

con.connect();

  con.login("myuid@gmail.com", "mypwd");

ChatManager chatmanager = con.getChatManager();

But the con.connect() method fails with the following stacktrace:

stream:error (text)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:306)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

The Smack debugger says the following messages are being exchanged:

SENT:

Any help?

thanks

ConnectionConfiguration configuration = new ConnectionConfiguration(“talk.google.com”, 5222, “gmail.com”);

XMPPConnection connection = new XMPPConnection(configuration);

connection.connect();

connection.login(user, password);

This should work (user is youruid without @gmail.com).

Message was edited by: alucard

I have the same problem and i tried many times and found the key is the ConnectionConfiguration third

parameter serviceName must be gmail.com.

this message is not appear in google talk’'s page ,

And i want to know who defined the serviceName?

google?

what’'s the meaning of this name?

That’'s the host-part of your jid. gmail offers @gmail.com, @googlemail.com and hosted domains. All of them go the same server (talk.google.com), but the server has to know which one you want to use somehow.

I’‘m really trying hard to connect to google talk servers too, but for me it seems like i’‘m using the wrong credentials, but i’'m quite sure i do use the correct ones? What can be wrong?

ConnectionConfiguration config = new ConnectionConfiguration(“talk.google.com”, 5222, “gmail.com”);

XMPPConnection connection = new XMPPConnection(config);

connection.connect();

connection.login(“myuid”, “passwd”);

Just in case you haven’'t seen it, please look at this thread

http://www.igniterealtime.org/forum/thread.jspa?threadID=26681 which explain a bug and solution to what you may be encountering.