Can not create persistent rooms

i create IM room but the room, i set IM room is persistent:

        /**XMPP会议室设置MUC*/
        // 获得聊天室的配置表单 根据原始表单创建一个要提交的新表单。
        Form form = muc.getConfigurationForm();
        Form answerForm = form.createAnswerForm();

        for(FormField formField:form.getFields()){
//            System.out.println(
//                    "TYPE(类型):"+formField.getType()+ ",Variable(参数):"+formField.getVariable());
            if(formField.getVariable() != null && !formField.getVariable().equals("FORM_TYPE")){
                System.out.println(formField.getVariable());
                answerForm.setDefaultAnswer(formField.getVariable());
            }
        }

        //房间名称
        answerForm.setAnswer("muc#roomconfig_roomname",roomname);
        //房间描述
        answerForm.setAnswer("muc#roomconfig_roomname","家庭圈");
        //房间是持久的
        answerForm.setAnswer("muc#roomconfig_persistentroom", true);
        //房间拥有者
        answerForm.setAnswer("muc#roomconfig_roomowners", owners);

        // 发送已完成的表单(有默认值)到服务器来配置聊天室
        muc.sendConfigurationForm(form);

the room is create success ,but the room persistent is fail ,
so i look code send message
the xml muc#roomconfig_persistentroom value is 0


i dont now why ? i setAnswer is true why have value is 0

I´m facing the same problem…

what is your environment?

I tried with Openfire 4.2.6 and Openfire 4.1.6 and using Smack 4.2.4 and 4.3.

The room was created but when I call disconnect, the room is destroyed.

How can you read the message sent (in your image) when you call muc.sendConfiguration ?

Thanks.

Hi @DavidGHS i found a workaround.

I tried:
answerForm.getField(“muc#roomconfig_persistentroom”).addValue(“1”);|

instead of

answerForm.setAnswer(“muc#roomconfig_persistentroom”, true);

and it works fine. It’s a thing to Smack developers work.