Bug in XHTMLManager#getBodies(Message)

Hi, I’'m using Smack 1.3.0.

I’'m invoking this method on a message I received from GAIM with the XHTML-IM extension, and I get the following exception:

java.lang.ClassCastException

at org.jivesoftware.smackx.XHTMLManager.getBodies(XHTMLManager.java:90)

at com.buddystream.plugins.jabber.XMPPSession.processInstantMessage(XMPPSession.ja va:356)

at com.buddystream.plugins.jabber.XMPPSession.processPacket(XMPPSession.java:347)

at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader .java:932)

at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:253)

at org.jivesoftware.smack.PacketReader.access$1(PacketReader.java:236)

at org.jivesoftware.smack.PacketReader$2.run(PacketReader.java:111)

The extension as returned by Message#getExtension(String, String) seems to be of type DefaultPacketExtension.

Javier,

You are getting a ClassCastException because Smack was not able to locate the smack.providers file. This file is present in the META-INF folder which must be present in your classpath.

This issue together with the thread “Unclear initialization of ServiceDiscoveryManager” makes me suspect that both issues are symptoms of the same problem. Please, try to add the META-INF folder to you classpath. FYI, there is another file in the folder META-INF which is used by Smack to figure out the classes to load at startup (e.g. ServiceDiscoveryManager).

Regards,

– Gato

Your suggestion fixed the problem, but please look at http://www.jivesoftware.com/jive/thread.jspa?threadID=12836&tstart=0 the problem still persists there.

Thanks,