1

I'm using Openfire to make an http-binding with Converse.js. I want to prebind it in order to make single session on my webapp. I used the java librarie smack-bosh.

I succeed to login (and stay logged) with converse directly to openfire (chat, add contact, join room, ...) I also succeed login smack to openfire and stay logged. I succesffuly retrieve Jid, Sid, Rid to prebind. I prebind and login with converse.js but i got disconnect because of overactivity. I set xmpp.httpbind.client.requests.ignoreOveractivity to true in OpenFire as mentioned here. Over activity is know fixed.

I stay logged if i do nothing. But as soon I try to send message or add contact or change status, OpenFire disconnect the session. In OpenFire logs, if I well understand, it's because the session is apparently "unavailable" but in reality converse is still connected because try to make a request and receive a "Invalid SID" Error.

OpenFire logs :

2014.08.22 17:26:05 org.jivesoftware.openfire.http.HttpSession - consumeResponse: org.jivesoftware.openfire.http.HttpSession@e8ecbb status: 3 address: test@127.0.0.1/fdf7cf75 id: fdf7cf75 presence:
<presence id="3bP9K-37" from="test@127.0.0.1/fdf7cf75" to="test@127.0.0.1/fdf7cf75"/> rid: 891999928666552
2014.08.22 17:26:05 org.jivesoftware.openfire.http.HttpSession - consumeResponse: org.jivesoftware.openfire.http.HttpSession@e8ecbb status: 3 address: test@127.0.0.1/fdf7cf75 id: fdf7cf75 presence:
<presence from="test@127.0.0.1/fdf7cf75">
<show>dnd</show>
</presence> rid: 891999928666553
2014.08.22 17:26:05 org.jivesoftware.openfire.http.HttpSession - consumeResponse: org.jivesoftware.openfire.http.HttpSession@e8ecbb status: 3 address: test@127.0.0.1/fdf7cf75 id: fdf7cf75 presence:
<presence from="test@127.0.0.1/fdf7cf75">
<show>dnd</show>
</presence> rid: 891999928666554
2014.08.22 17:26:09 org.jivesoftware.openfire.http.HttpSession - consumeResponse: org.jivesoftware.openfire.http.HttpSession@e8ecbb status: -1 address: test@127.0.0.1/fdf7cf75 id: fdf7cf75 presence:
<presence type="unavailable" from="test@127.0.0.1/fdf7cf75"/> rid: 891999928666554 

converse logs :

0 request id 3.0 posting converse.min.js:223
0 request id 3.0 state changed to 1 converse.min.js:223
<body rid=​"891999928666554" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"fdf7cf75">​    </body>​ converse.min.js:223
0 request id 3.1 state changed to 2 converse.min.js:223
0 request id 3.1 state changed to 3 converse.min.js:223
0 request id 3.1 state changed to 4 converse.min.js:223
0 removing request converse.min.js:223
0 _throttledRequestHandler called with 0 requests converse.min.js:223
0 request id 3 should now be removed converse.min.js:223
0 request id 3.1 got 200 converse.min.js:223
1 _dataRecv called converse.min.js:223
<body xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind">​</body>​ converse.min.js:223
1 no requests during idle cycle, sending blank request converse.min.js:223
0 request id 4.0 posting converse.min.js:223
0 request id 4.0 state changed to 1 converse.min.js:223
<body rid=​"891999928666555" xmlns=​"http:​/​/​jabber.org/​protocol/​httpbind" sid=​"fdf7cf75">​</body>​ converse.min.js:223
POST http://127.0.0.1:7070/http-bind/ 404 (Invalid SID.) converse.min.js:223
  l converse.min.js:223
  Strophe.Bosh._processRequest converse.min.js:223
  Strophe.Bosh._throttledRequestHandler converse.min.js:223
  Strophe.Bosh._sendTerminate converse.min.js:223
  Strophe.Bosh._disconnect converse.min.js:223
  t.Connection.disconnect converse.min.js:223
  t.Connection._dataRecv converse.min.js:223
  Strophe.Bosh._onRequestStateChange
0 request id 4.1 state changed to 2 converse.min.js:223
0 request id 4.1 state changed to 3 converse.min.js:223
0 request id 4.1 state changed to 4 converse.min.js:223
0 removing request converse.min.js:223
0 _throttledRequestHandler called with 0 requests converse.min.js:223
0 request id 4 should now be removed converse.min.js:223
ERROR: request id 4.1 error 404 happened converse.min.js:223
2 request errored, status: 404, number of errors: 1 converse.min.js:223
1 _doDisconnect was called

Stanza logs :

<jive xmlns="http://www.jivesoftware.org">
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="connected" timestamp="août 22, 2014 06:05:26:873 PM"><iq xmlns="" id="3bP9K-42" type="set"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource/></bind></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:876 PM"><iq xmlns="" type="result" id="3bP9K-42" to="127.0.0.1/ec1f570e"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>test@127.0.0.1/ec1f570e</jid></bind></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:881 PM"><iq xmlns="" id="3bP9K-43" type="set" from="test@127.0.0.1/ec1f570e"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:881 PM"><iq xmlns="" type="result" id="3bP9K-43" to="test@127.0.0.1/ec1f570e"/></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:892 PM"><iq xmlns="" id="3bP9K-44" type="get" from="test@127.0.0.1/ec1f570e"><query xmlns="jabber:iq:roster"/></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:913 PM"><iq xmlns="" type="result" id="3bP9K-44" to="test@127.0.0.1/ec1f570e"><query xmlns="jabber:iq:roster"/></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:914 PM"><presence xmlns="" id="3bP9K-45" from="test@127.0.0.1/ec1f570e"/></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:915 PM"><presence xmlns="" id="3bP9K-45" from="test@127.0.0.1/ec1f570e" to="test@127.0.0.1/ec1f570e"/></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:27:078 PM"><iq xmlns="" type="get" id="1:roster" from="test@127.0.0.1/ec1f570e"><query xmlns="jabber:iq:roster"/></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:27:078 PM"><iq xmlns="" type="result" id="1:roster" to="test@127.0.0.1/ec1f570e"><query xmlns="jabber:iq:roster"/></iq></packet>

Thanks for help.

Brendan Long
  • 53,280
  • 21
  • 146
  • 188
GuiguiDt
  • 263
  • 1
  • 11
  • Can you provide a log of the stanza's sent between Converse and Openfire before and after the disconnect? – fpsColton Aug 22 '14 at 15:50
  • Is that enough? I had to tell that I didn't know theses logs, I will do some research on it this week-end. But if u see a solution meanwhile, I will be grateful. – GuiguiDt Aug 22 '14 at 16:13
  • The stanza's you provided do not look like normal BOSH stanzas, none of them have and SID or RID values... If you run a program such as Fiddler2 and just monitor the traffic going to and from your `/http-bind/` url you should be able to have a clear view of the stanzas. – fpsColton Aug 22 '14 at 17:09
  • @fpsColton Before trying to retrieve stanza, I read [here](https://stackoverflow.com/questions/25455638/) your answer and it seems that not closing the client was my problem cause whith this fix, everything seems to work well. So thanks for your answer on the other post. – GuiguiDt Aug 25 '14 at 13:06

0 Answers0