0
votes

I am trying to connect ejabberd server from Java using the Smack API. When I am using the following code I could connect to ejabberd server.

XMPPTCPConnection connection = new XMPPTCPConnection("localhost");
connection.connect();

However, while I am using ConnectionConfiguration in the following manner it shows Connection Exception Or No Response error.

    ConnectionConfiguration conf = new ConnectionConfiguration("localhost",5280);
    conf.setReconnectionAllowed(false);
    XMPPTCPConnection connection = new XMPPTCPConnection(conf);
    connection.connect();

I could not able to solve the problem. Please help .

1
This question seems similar.legoscia

1 Answers

0
votes

I see you are using port 5280. This is HTTP port for XMPP over Bosh. However, you are trying to connect using XMPP over standard TCP socket. Are you sure you should not use port 5222 ?