Adding member to MUC in XMPP(SMACK)
<p>I am trying to create multi user chat using XMPP(smack). After creation of room when i try to join to chat room then there is no entry of joined member in <strong>ofmucmember</strong>.</p>

<p>Creation of room code is as below : </p>

<pre><code>public void createMultiUserChatRoom(String roomName, String nickName) {

        MultiUserChatManager multiUserChatManager = MultiUserChatManager.getInstanceFor(connection);

        MultiUserChat multiUserChat = multiUserChatManager.getMultiUserChat(roomName+"@conference.localhost");

        try {
            multiUserChat.create(nickName);

            Form form = multiUserChat.getConfigurationForm();
            Form submitForm = form.createAnswerForm();

            List&lt;FormField&gt; formFieldList = submitForm.getFields();
            for (FormField formField : formFieldList) {
                if(!FormField.Type.hidden.equals(formField.getType()) &amp;&amp; formField.getVariable() != null) {
                    submitForm.setDefaultAnswer(formField.getVariable());
                }
            }

            submitForm.setAnswer("muc#roomconfig_persistentroom", true);
            submitForm.setAnswer("muc#roomconfig_publicroom", true);
            submitForm.setAnswer("muc#roomconfig_enablelogging", true);
            submitForm.setAnswer("x-muc#roomconfig_reservednick", false);
            submitForm.setAnswer("x-muc#roomconfig_canchangenick", false);
            submitForm.setAnswer("x-muc#roomconfig_registration", false);
            submitForm.setAnswer("muc#roomconfig_passwordprotectedroom", false);
            submitForm.setAnswer("muc#roomconfig_roomname", roomName);
             submitForm.setAnswer("muc#roomconfig_whois", Arrays.asList("none"));
            multiUserChat.sendConfigurationForm(submitForm);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
</code></pre>

<p>Code for joining the created room is as below:</p>

<pre><code>    public void joinMultiUserChatRoom(String userName, String roomName) {
            MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);

            MultiUserChat multiUserChat = manager.getMultiUserChat(roomName + "@conference.localhost");
            DiscussionHistory history = new DiscussionHistory();
            history.setMaxStanzas(0);
            try {
                multiUserChat.join(userName);
                multiUserChat.sendMessage(userName +" : You have joined the group : " + roomName);

                Presence presence = multiUserChat.getOccupantPresence(roomName + "@conference.localhost/" + userName);
                presence.setMode(Presence.Mode.available);
                connection.sendStanza(presence);

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
</code></pre>

<p>Response from server :</p>

<pre><code>&lt;message to="admin@localhost/Smack" id="h7axM-14" type="groupchat" from="team6@conference.localhost/roy"&gt;&lt;body&gt;roy : You have joined the group : team6&lt;/body&gt;&lt;x xmlns="jabber:x:delay" stamp="20160623T12:15:50" from="team6@conference.localhost/roy"/&gt;&lt;/message&gt;
presence :&lt;presence to='admin@localhost/Smack' id='WR9Dy-12'&gt;&lt;x xmlns='http://jabber.org/protocol/muc#user'&gt;&lt;item affiliation='owner' jid='admin@localhost/Smack' role='moderator'&gt;&lt;/item&gt;&lt;/x&gt;&lt;c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.igniterealtime.org/projects/smack' ver='NfJ3flI83zSdUDzCEICtbypursw='/&gt;&lt;/presence&gt;
</code></pre>

<p>I am not getting any error. Can anybody tell me where i am wrong here?</p>