powered by Jive Software

Connection error with google talk

Hey, i’'m trying to connect with google talk and send a message to an user but it makes an exception:

My source code is:

class prueba {

public static void main (String args[]){

try{

GoogleTalkConnection con = new GoogleTalkConnection();

con.login(“mylogin”, “password”);

      con.createChat("user@gmail.com")

.sendMessage(“hello!”);

}catch(Exception e){ System.out.println("error: "+e);}

}

}

when run, the following exception ocurrs:

java.lang.ClassCastException: org.jivesoftware.smack.PacketReader$4

at org.jivesoftware.smack.SASLAuthentication.bindResourceAndEstablishSes

sion(SASLAuthentication.java:300)

at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentica

tion.java:210)

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:410)

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:374)

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:355)

at prueba.main(prueba.java:17)

error: (405)

How can I solve it?