Issue with obtaining the offline messages using openfire server

Offline messages are not delivering to the user when the person avails.

Code:

DelayInformation info = (DelayInformation)message.getExtension(“x”,“jabber:x:delay”);

returns null.

when i iterate the collection of message.getExtensions() , i get delay urn:xmpp:delay.

can anyone explain on this.

I’m using smack and smackx.jar. Though the smackx.jar has smack.providers it’s not taken into account.

jabber:x:delay has been deprecated for (both in Openfire and Smack). Use urn:xmpp:delay instead.

The above solution ends in class cast exception as below

java.lang.ClassCastException: org.jivesoftware.smack.PacketReader$4 cannot be cast to org.jivesoftware.smackx.packet.StreamInitiation

code:

DelayInformation info = (DelayInformation)message.getExtension(“delay”,“urn:xmpp:delay”);

work around so far, some of them suggested to set providerManager manually before calling xmpp connection and some suggested smackx properties would not loaded properly(meta-inf/smack.provider)

both doesn’t resolve the problem …any other suggestions to proceed with ?