event
hi wvwn i am new to samck api
and trying to connect to facebook and followed your steps mentioned above but got the following error
connected to facebook
Exception in thread “Smack Packet Reader (0)” java.lang.NoSuchMethodError: org.j
ivesoftware.smack.SASLAuthentication.send(Ljava/lang/String;)V
at MySASLDigestMD5Mechanism.challengeReceived(MySASLDigestMD5Mechanism.j
ava:80)
at org.jivesoftware.smack.SASLAuthentication.challengeReceived(SASLAuthe
ntication.java:514)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:29
-
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)
No response from the server.:
at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuth
entication.java:73)
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentica
tion.java:352)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
at org.jivesoftware.smack.Connection.login(Connection.java:348)
at Facebook.login(Facebook.java:93)
at Facebook.main(Facebook.java:33)
D:\try fb>
my code is
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.SASLAuthentication;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
public class Facebook {
/**
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
login(“facebokusername”, “fbpasword”);
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void login(String userName, String password) throws XMPPException
{
SASLAuthentication.registerSASLMechanism(“DIGEST-MD5”,MySASLDigestMD5Mechanism. class);
//((SASLAuthentication) ss).registerSASLMechanism(“DIGEST-MD5”,MySASLDigestMD5Mechanism.class);
ConnectionConfiguration config = new ConnectionConfiguration(“chat.facebook.com”,5222);
config.setSASLAuthenticationEnabled(true);
config.setRosterLoadedAtLogin (true);
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
System.out.print(“connected to facebook\n”);
connection.login(userName, password);
System.out.print(“logged to facebook\n”);
}
}
i have used the facebook username and the password for the same but could not log in to accoutn and ended up with the above error
evne i tried your zip files but have the same error for them, after removing the chatframe code fragment
please help…