How to login ejabberd server

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.

I am not sure, what this method does in Smack:

config.setSASLAuthenticationEnabled(false);

But I suspect it would disallow authentication^^.

Consequently you can’t login.

Also usually the username is without the domain name (“localhost”), at least with Openfire.

Hi, CSH,

You are right, config.setSASLAuthenticationEnabled(false) java statement just want to disable ssl-authentication.

It’s not work that username without ‘localhost’ yet.

Thanks.