After upgrade to 4.2.0 BOSH login does not work

Hy,

We are experiencing some really blocker problems. We used smack at version 4.1.9 and everything was going well with the connection and login phase, after upgrading to 4.2.0 after we call connect() on XMPPBOSCHConnection it says it is connected and then we call login and we got a serious NPE which says

java.lang.NullPointerException

at java.util.Collections$UnmodifiableCollection.(Collections.java:1026)

at java.util.Collections$UnmodifiableSet.(Collections.java:1128)

at java.util.Collections.unmodifiableSet(Collections.java:1118)

at org.jivesoftware.smack.ConnectionConfiguration.getEnabledSaslMechanisms(Connect ionConfiguration.java:476)

at org.jivesoftware.smack.SASLAuthentication.selectMechanism(SASLAuthentication.ja va:359)

at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 191)

at org.jivesoftware.smack.bosh.XMPPBOSHConnection.loginInternal(XMPPBOSHConnection .java:222)

at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java :491)

at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java :448)

Where

public Set getEnabledSaslMechanisms() {

return Collections.unmodifiableSet(enabledSaslMechanisms);

}

enabledSaslMechanisms is NULL…

Some strange things happens when we PUT a Thread.sleep between the connect and login, then the whole process goes right and the user is connected to the server…

We need some help in this case, we think there maybe the connect and login start two different threads or wait too long and the login gets another instance of the connection where the config hasn’t been processed.

I hope you can help us, we use Ejabberd for the server.

All the best,

Holi60