powered by Jive Software

Weird Message.body is null problem


I’m trying to connect to a specific Openfire external server component with XIFF, i.e. let’s say my Openfire server is dev.mydomain.com and the component (service) name would be myservice.dev.mydomain.com. This backend service is programmed so that when it receives a Presence message, it sends back some initialization XML to start up my app. I first connect normally to dev.mydomain.com and in onLogin() I do:

var presence:Presence = new Presence("corechat@myservice.dev.mydomain.com", this.connection.jid.escaped, null, null, null);


I have separate listeners for the IncomingDataEvent and MessageEvent events. In IncomingData I get (correctly):


However, in onMessage when I try:

private function onMessage(e:MessageEvent):void


var msg:Message = e.data as Message;

trace(“onMessage type=”, msg.type, “from=”, msg.from, “to=”, msg.to, “body=”, msg.body);


msg.body is null. I have tried with earlier XIFF versions so I think this is a longstanding bug, or then I’m doing something wrong. Can anyone help please?

Best regards,


Are you using the latest version from SVN and can you possibly point when this bug has been introduced in the history of SVN?

Forget about it… my bad. Or the guy’s who coded the server component

Instead of setting the Message body with setBody() (in Java), he created a PacketExtension named “body” – aaaarrghh… So XIFF correctly determined that body is null (because it wasn’t set with setBody()), but the actual message still looked correct.