Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

how to login ejabberd server

$
0
0

Hi,

I build a ejabberd xmpp server on intranet at 192.168.4.11:5222. The general xmpp client can login/message succeed, but I use the following code

 

import static java.lang.System.out;

import java.lang.System;

import java.io.Console;

import org.jivesoftware.smack.*;

 

 

public class Xcj {

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

        ConnectionConfiguration config = new ConnectionConfiguration("192.168.4.11", 5222, "localhost");

        config.setSASLAuthenticationEnabled(false);

        //config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);

        XMPPConnection conn = new XMPPConnection(config);

 

 

        try {

            conn.connect();

            conn.login("test2@localhost", "Welc0me", "ubuntu");

        } catch (XMPPException e) {

            out.println(e);

        } finally {

            //;

        }

 

 

        Console c = System.console();

        String s = c.readLine("quit/continue");

        out.println(s);

    }

 

 

}

 

I got "service-unavailable(503)", the xmpp server is ok, how to resolve it?

 

thanks.


Viewing all articles
Browse latest Browse all 10742

Trending Articles