powered by Jive Software

Creating a MUC - ClassCastException in DefaultPacketExtension


I’m trying to create a MUC from my Android code. Joining an existing MUC is OK.

Server is Openfire 3.6.4.

I get:

11-20 14:36:28.465 E/AndroidRuntime( 2008): java.lang.ClassCastException: org.jivesoftware.smack.packet.DefaultPacketExtension

11-20 14:36:28.465 E/AndroidRuntime( 2008): at org.jivesoftware.smackx.muc.MultiUserChat.getMUCUserExtension(MultiUserChat.jav a:1986)

11-20 14:36:28.465 E/AndroidRuntime( 2008): at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:350)

Sorry, got posted early.

Line 1986:

return (MUCUser) packet.getExtension(“x”, “http://jabber.org/protocol/muc#user”);

Line 350:

MUCUser mucUser = getMUCUserExtension(presence);

I logged the packet sent and received. The x element is empty:

11-20 15:06:13.985 D/MultiUserChat( 2049): send: joinPresence=

11-20 15:06:14.105 D/MultiUserChat( 2049): received: presence=

which causes packet.getExtension() to be null, which causes the ClassCastException.

When doing this in Pidgin:

4:04 You have connected

4:04 user1 [user1@xmpp.paraz.com/Migs-MacBook] entered the room.

4:04 This room is locked from entry until configuration is confirmed.

then a dialog appeared: Create new room … Would you like to configure it, or accept the default settings?

When Accept Defaults is chosen:

4:05 This room is now unlocked.

How do we do this using Smack?

me too,我也是MultiUserChat在android上的问题。请求答案中……

It’s a good chance that your smack.providers file is not on your classpath. This would result in the default provider being used instead of the specific MUC one.

Hi !

I have exactly the same problem (and the same error message) but my smack.providers is already in my META-INF folder, do you have any idea why I have this error ?