powered by Jive Software

Problem connecting to OpenFire

I’ve been working off the xiff trunk for some time now without problem. I recently did an update and picked up some changes which have stopped my application from logging into OpenFire. A copy of the outgoing and incoming data from my client application on a login attempt is as follows:


OutgoingDataEvent: <?xml version="1.0" encoding="UTF-8"?><stream:stream xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” to=“chanima” xml:lang=“en” version=“1.0”>

ConnectionSuccessEvent received

IncomingDataEvent: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“chanima” id=“5372e05a” xml:lang=“en” version=“1.0”>stream:featuresDIGEST-MD5PLAINANONYMOUSCRAM-MD5</mech anism>zlib</stream:features>

OutgoingDataEvent: cm9iQGNoYW5pbWEAcm9iAHNub3cyZGF5


I reverted back to the older version of my Xiff codebase and everything worked fine. A copy of the outgoing and incoming data for this version of the codebase is as follows:


<?xml version="1.0" encoding="UTF-8"?>

ConnectionSuccessEvent received

IncomingDataEvent: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“chanima” id=“55b680e5” xml:lang=“en” version=“1.0”>stream:featuresDIGEST-MD5PLAINANONYMOUSCRAM-MD5</mech anism>zlib</stream:features>

OutgoingDataEvent: cm9iQGNoYW5pbWEAcm9iAHNub3cyZGF5

IncomingDataEvent:
OutgoingDataEvent: <?xml version="1.0" encoding="UTF-8"?><stream:stream xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” to=“chanima” xml:lang=“en” version=“1.0”>

There’s more to follow needless to say it log’s in successfully


Any help here would be greatly appreciated. Is there something extra I now need to configure in Openfire for the latest version of Xiff?

Regards

Rob

Forgot to attach my connection code:

xmppConnection = new XMPPConnection();

// Listeners

xmppConnection.addEventListener(ConnectionSuccessEvent.CONNECT_SUCCESS,onConnect Success);

xmppConnection.addEventListener(XIFFErrorEvent.XIFF_ERROR,onError);

xmppConnection.addEventListener(OutgoingDataEvent.OUTGOING_DATA,onOutgoingData)

xmppConnection.addEventListener(IncomingDataEvent.INCOMING_DATA,onIncomingData);

xmppConnection.addEventListener(DisconnectionEvent.DISCONNECT,onDisconnect);

xmppConnection.addEventListener(org.igniterealtime.xiff.events.LoginEvent.LOGIN, onLogin);

xmppConnection.username = “userid”;
xmppConnection.password = “password”;
xmppConnection.server = “server”;
xmppConnection.connect(XMPPConnection.STREAM_TYPE_STANDARD);

Having another look at the logging, it seems the difference between the current behaviour and the older working behaviour is Xiff is deciding to use some sort of stream compression/encryption. I don’t see any way to control this explicitly in the connection object and can only assume Xiff is doing this because it thinks the server will support the mode of communication. At any rate the server does not appear to be responding once Xiff goes into this mode.

Again, any help here would be greatly appreciated, I would rather not be stuck on a month old version of trunk code and am running out of ideas.

Regards

Rob

Which version of Openfire are you using?

I started with 3.5.2, after the problems began I upgraded to 3.6.4, but it didn’t make a difference.

It does seem to be broken.

I think one of the more recent commits has caused the issue.

I tested in the XIFF GUI (updated to the most recent library) and it does exactly what you are saying.

The issue seems to be in the sendXML method of XMPPConnection.

In the previous version, the XMLSocket sent the XML straight but in the latest version, the Socket is sending a ByteArray.

The XML passed into the sendXML method is correct, so it seems to be an issue with the ByteArray.

Hopefully Juga can confirm this. I think he was working on these changes.

Its actually an easy fix.

Until the library gets updated, you can add the following as the first line of sendXML() in XMPPConnection:

someData = someData is XML ? XML( someData ).toXMLString() : someData;

Thanks Mark, the patch works.

Rob

Ou yea, the toString() is called by default when something is passed soemwhere where a string is expected.

Your fix committed.

These problems appear as I have worked the rewrite to XML only until half way and then stopped having time for it, and now sometimes I am trying to put some of those changes in.