Unable to do a basic connect using latest 4.1 beta version

Getting this error

W/AbstractXMPPConnection﹕ Connection closed with error

org.jivesoftware.smack.SmackException: Parser got END_DOCUMENT event. This could happen e.g. if the server closed the connection without sending a closing stream element

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1107)

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:896)

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:911)

at java.lang.Thread.run(Thread.java:818)

XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()

.setHost(“talk.google.com”)

.setServiceName(“gmail.com”)

.setCompressionEnabled(false).build();

XMPPTCPConnection connection = new XMPPTCPConnection(config);

        try {

connection.connect();

} catch (XMPPException e) {

e.printStackTrace();

} catch (SmackException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

}

connection.addConnectionListener(new ConnectionListener() {

@Override

public void connected(XMPPConnection connection) {

Log.d("ARUN SHANKAR SMACK ", “connected”);

}

@Override

public void authenticated(XMPPConnection connection, boolean resumed) {

Log.d("ARUN SHANKAR SMACK ", “authenticated”);

}

@Override

public void connectionClosed() {

Log.d("ARUN SHANKAR SMACK ", “connection closed”);

}

@Override

public void connectionClosedOnError(Exception e) {

Log.d("ARUN SHANKAR SMACK ", “connection closed on error”);

}

@Override

public void reconnectionSuccessful() {

Log.d("ARUN SHANKAR SMACK ", “reconnected”);

}

@Override

public void reconnectingIn(int seconds) {

Log.d("ARUN SHANKAR SMACK ", “reconnecting”);

}

@Override

public void reconnectionFailed(Exception e) {

Log.d("ARUN SHANKAR SMACK ", “reconnecting failed”);

}

});

1 Like

Please follow the instructions found at https://github.com/igniterealtime/Smack/wiki/How-to-ask-for-help-or-report-an-is sue. Especially an XMPP trace obtained with ‘SmackConfiguration.DEBUG = true’ would be helpful. Thank you.

Hi Flow,

I have enabled DEBUG and also have captured the version as mentioned in the link that you have given

XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()

.setHost(“talk.google.com”)

.setServiceName(“gmail.com”)

.setCompressionEnabled(false).build();

SmackConfiguration.DEBUG=true;

Log.d(“Smack version”,SmackConfiguration.getVersion());

XMPPTCPConnection connection = new XMPPTCPConnection(config);

try {

connection.connect();

} catch (XMPPException e) {

e.printStackTrace();

} catch (SmackException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

}

connection.addConnectionListener(new ConnectionListener() {

@Override

public void connected(XMPPConnection connection) {

Log.d("ARUN SHANKAR SMACK ", “connected”);

}

@Override

public void authenticated(XMPPConnection connection, boolean resumed) {

Log.d("ARUN SHANKAR SMACK ", “authenticated”);

}

@Override

public void connectionClosed() {

Log.d("ARUN SHANKAR SMACK ", “connection closed”);

}

@Override

public void connectionClosedOnError(Exception e) {

Log.d("ARUN SHANKAR SMACK ", “connection closed on error”);

}

@Override

public void reconnectionSuccessful() {

Log.d("ARUN SHANKAR SMACK ", “reconnected”);

}

@Override

public void reconnectingIn(int seconds) {

Log.d("ARUN SHANKAR SMACK ", “reconnecting”);

}

@Override

public void reconnectionFailed(Exception e) {

Log.d("ARUN SHANKAR SMACK ", “reconnecting failed”);

}

});

02-13 15:18:21.193 6682-6682/com.example.arunshankar.chat D/Smack version﹕ 4.1.0-beta2 (4.0.6-494-g4b21581 2015-02-02)

02-13 15:18:42.093 6682-6728/com.example.arunshankar.chat W/AbstractXMPPConnection﹕ Connection closed with error

org.jivesoftware.smack.SmackException: Parser got END_DOCUMENT event. This could happen e.g. if the server closed the connection without sending a closing stream element

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1107)

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:896)

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:911)

at java.lang.Thread.run(Thread.java:818)

02-13 15:18:42.120 6682-6728/com.example.arunshankar.chat D/ARUN SHANKAR SMACK﹕ connection closed on error