title: Can't create a multi user chat (MUC) room with aSmack library for Android: "packet.DefaultPacketExtension cannot be cast to packet.MUCUser"
body: <p>For an application I need to be able to create a multi user chatroom and join it. The chat server is a openfire server.</p>
  
  <p>I used to have:</p>
  
  <pre><code>MultiUserChat chat = new MultiUserChat(connection, roomName + "@conference.localhost");
  chat.join(nickname);
  </code></pre>
  
  <p>When the room doesn't exist it creates the room and joins. however the next user can't join. He get's a 404, recipient unavailable(404). Which suggests the chatroom is locked or something.</p>
  
  <p>Then I found code in the documentation and I tried the following:</p>
  
  <pre><code>chat.create(nickname);
  
  // Send an empty room configuration form which indicates that we want
  // an instant room
  chat.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
  </code></pre>
  
  <p>However when I try to execute this it says it crashes with the following error in the logcat:</p>
  
  <pre><code>03-02 12:04:12.890: E/AndroidRuntime(20872): FATAL EXCEPTION:
  
   AsyncTask #3 03-02 12:04:12.890: E/AndroidRuntime(20872):
  
   java.lang.RuntimeException: An error occured while executing
   doInBackground() 
  03-02 12:04:12.890: E/AndroidRuntime(20872): Caused
   by: java.lang.ClassCastException:
  
   org.jivesoftware.smack.packet.DefaultPacketExtension cannot be cast to
   org.jivesoftware.smackx.packet.MUCUser 03-02 12:04:12.890:
   E/AndroidRuntime(20872):   at
   org.jivesoftware.smackx.muc.MultiUserChat.getMUCUserExtension(MultiUserChat.java:2002)
   03-02 12:04:12.890: E/AndroidRuntime(20872):   at
   org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:364)
   03-02 12:04:12.890: E/AndroidRuntime(20872):   at
   be.xios.crs.pivi.managers.XmppManager.createOrJoinChatGroup(XmppManager.java:116)
  </code></pre>
  
  <p>Hope someone can help me with this and give some advise.</p>