Question

I'm trying to establish a connection to an XMPP server using smack.

ConnectionConfiguration cf = new ConnectionConfiguration("jabber.ccc.de");
cf.setTruststorePassword("changeme");
this.connection = new XMPPConnection(cf);
this.connection.connect();
this.connection.login("user", "password");

But whenever logging in I get an XMPPException (No response from the server.: ) and the socket gets closed.

Any ideas what's going wrong here?

Regards

Was it helpful?

Solution

Have you tried seeing what the actual XMPP data being sent to/from the server is?

Try adding this to your code at startup:

System.setProperty("smack.debugEnabled", "true");
XMPPConnection.DEBUG_ENABLED = true;

OTHER TIPS

Try this one.

ConnectionConfiguration cf = new ConnectionConfiguration("jabber.ccc.de",5222, "test");
cf.setTruststorePassword("changeme");
this.connection = new XMPPConnection(cf);
this.connection.connect();
this.connection.login("user", "password");

Just put the following line before you make the connection.

SASLAuthentication.supportSASLMechanism("PLAIN");

This problem was addressed by a person called Davanum; see the link

The problem is : you are behind a slow internet connection. You need to increase time out for packet reply in smack config.

Strangely, you can get this problem, only the first time, after a boot of the client system (windows).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top