Yes I tried that also, it jbosh does not allow null which will again throw another exception
so what I did is I overrided the disconnect() from AbstractXMPPConnection and I call super.disconnect()
@Override
public void disconnect() {
synchronized (client) {
try {
client.disconnect();
} catch (BOSHException e) {
}finally{
super.disconnect();
}
}
}
which will do the jbosh disconnect as well as the XMPP disconnect unfortunately 2 unavailable presence will be sent
And I swallow the Exception in shutdown... probably a semi standard workaround
try {
if (client != null) {
client.close();
}
} catch (Exception e) {
// Ignore
} finally {
client = null;
}