powered by Jive Software

aSmack-4.0.0-rc2 ResourceBindingNotOfferedException

Hi everyone, just tested asmack-android-8-4.0.0-rc2-SNAPSHOT-2014-04-30.jar. It throws ResourceBindingNotOfferedException on login.

Here is code to test:

SmackConfiguration.DEBUG_ENABLED = true;

String host = “chatstage.quickblox.com”;

ConnectionConfiguration configuration = new ConnectionConfiguration(host);

configuration.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);

final XMPPConnection connection = new XMPPTCPConnection(configuration);

connection.connect();

connection.login(“18551-438”, “videoChatUser1”);

Log:

SENT (0): <stream:stream to=“chatstage.quickblox.com” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” version=“1.0”>

RCV (0): <?xml version='1.0'?><stream:stream xmlns=‘jabber:client’ xmlns:stream=‘http://etherx.jabber.org/streams’ from=‘chatstage.quickblox.com’ id=‘1b2bc566-f142-4a37-9a31-52028d43ac31’ version=‘1.0’ xml:lang=‘en’>

RCV (0): stream:featuresPLAINANONYMOUSzlib</stream:features>

SENT (0): ADE4NTUxLTQzOAB2aWRlb0NoYXRVc2VyMQ==</ auth>

RCV (0):

SENT (0): <stream:stream to=“chatstage.quickblox.com” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” version=“1.0”>

At a first look the exception seems to be correct as the server does not offer resource binding (RFC6120 7.4). Which server and version do you use?

We use Tigase 5.2.

One sec. Could also be a missing synchronisation point in Smack that was lost when resource binding got refactored out of of sasl auth. I’ll be having a deeper look and may provide a new aSmack version for testing soon. Thanks for your help.

As supposed it appears to be a missing synchronization point regarding binding required. I was able to connect to chatstage.quickblox.com with the credentials provided with the latest -rc2 snapshot. The fix is ed8b80c2 and is included in the Smack and aSmack 4.0.0-rc2-SNAPSHOTS (from 2014-05-03 on).

It would appreciate if you guys (Igor, Jens, oscarthecat) would test the snapshots and report the results back. Thank you.

I can report that the “ResourceBindingNotOfferedException” no longer appears. Thank you very much!

Unfortunately, now I get this exception:

Mai 05, 2014 9:00:43 AM org.jivesoftware.smack.XMPPConnection$ListenerNotification run

SEVERE: Exception in packet listener

java.lang.NullPointerException

at org.jivesoftware.smack.util.LazyStringBuilder.length(LazyStringBuilder.java:59)

at org.jivesoftware.smack.util.XmlStringBuilder.length(XmlStringBuilder.java:193)

at org.jivesoftware.smack.util.LazyStringBuilder.length(LazyStringBuilder.java:59)

at org.jivesoftware.smack.util.LazyStringBuilder.toString(LazyStringBuilder.java:8 3)

at org.jivesoftware.smack.util.XmlStringBuilder.toString(XmlStringBuilder.java:208 )

at org.jivesoftware.smack.debugger.LiteDebugger$10.processPacket(LiteDebugger.java :244)

at org.jivesoftware.smack.XMPPConnection$ListenerWrapper.notifyListener(XMPPConnec tion.java:1196)

at org.jivesoftware.smack.XMPPConnection$ListenerNotification.run(XMPPConnection.j ava:1106)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Unfortunately, now I get this exception:

Mai 05, 2014 9:00:43 AM org.jivesoftware.smack.XMPPConnection$ListenerNotification run

SEVERE: Exception in packet listener

java.lang.NullPointerException

at org.jivesoftware.smack.util.LazyStringBuilder.length(LazyStringBuilder.java:59)

Well, at least we know that this can’t be a side-effect of the now working login process. Somehow a ‘null’ value is added to LazyStringBuilder’s List. If you enable assertions, then a exception is thrown onces this is tried. Please open a new thread if you need further assitance tracking down the root cause.

Thank you, I checked new snapshot, it works.

just updated with SNAPSHOT 05-06 and my code works, thanks Flow