Creating the GroupChat-room on the fly, when users are active


I want to create the GroupChat-room when users are active. Based on following code, I am able to create chat-room (set persistance to false), but it shows the ?No response from server? when executing the call setConfigurationForm() from the MultiUserChat object.

String roomId =?user@serviceName?;

MultiUserChat muc = new MultiUserChat(con, roomed);


// create configuration

Form form = muc.getConfigurationForm();

Form submitForm = form.createAnswerForm();

for (Iterator fields = form.getFields(); fields.hasNext():wink: {

FormField field = (FormField);

if (FormField.TYPE_BOOLEAN.equals(field.getType()) &&

(field.getVariable().equals(“persistance”))) {

submitForm.setAnswer(field.getVariable(), new Boolean(false));



// Sets the new owner of the room

muc.sendConfigurationForm(submitForm); // ERROR shows

No response from server.:

org.jivesoftware.smackx.muc.MultiUserChat.sendConfigurationForm(MultiUserChat.ja va:556)

at com.gropchat.TestGroupChat.main(

If any body knows, please reply ASAP.



I think the form field is “persistentroom” and not “persistance”.

Yep it is:

if (“muc#roomconfig_persistentroom”.equals(fieldVariable)) {

formField = new FormField(“muc#roomconfig_persistentroom”);


submitForm.addField(formField); omconfig

Change it to the correct property name and see if that helps you out.