3

重複の可能性:
Smack を使用して Facebook チャットを統合中に SASL 認証が失敗する

このコードをコンパイルしようとすると、常にこの例外が発生します


org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395)
で org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:325)でメカニ​​ズムDIGEST-MD5 を使用して SASL 認証が失敗し
ました。
SimpleConnection.main(SimpleConnection.java:31) の XMPPConnection.login(XMPPConnection.java:349 )

コード :

import javax.swing.JOptionPane;
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.XMPPConnection;

import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.MessageListener;

import org.jivesoftware.smack.SASLAuthentication;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

public class SimpleConnection {

    static String username = "";
    static String password = "";

    public SimpleConnection() {
    }

    public static void main(String[] args) {
        try {

           SASLAuthentication.registerSASLMechanism("DIGEST-MD5", MySASLDigestMD5Mechanism.class);
            ConnectionConfiguration conf = new ConnectionConfiguration("chat.facebook.com", 5222);
            XMPPConnection con = new XMPPConnection(conf);
            con.connect();
            con.login(username, password);

            //Chat c = con.getChatManager().createChat("atopmax", new aa());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

私は何を間違っていますか?ありがとう!

4

0 に答える 0