multiUserChat.getOwners() throws a 404 or no response

Hello all,

I have the following method that retrieves a listing of all rooms on the server.

XMPPConnection connx = (XMPPConnection) conn;

Collection rooms = MultiUserChat.getHostedRooms(connx,CONFERENCE_SERVICE_NAME);

Iterator it = rooms.iterator();

if(rooms.size() > 0)

{

while(it.hasNext())

{

HostedRoom roomName = (HostedRoom) it.next();

MultiUserChat muc = new MultiUserChat(connx,roomName.getName());

Collection collection = muc.getOwners(); //error thrown here.

/code

When a room is created, does the creator of the room automatically become the owner or do I need to specify an owner during room creation using the Form object?

Is there an easier way to get the owner(s) from the HostedRoom object without having to instantiate a MultiUserChat object?

TIA!

Message was edited by: gforty

OK, I recently upgraded to wildfire 3.1.1 from 2.7.x…

The following method is also giving me the No response from server.: error

public void getRoomParms()throws XMPPException

{

XMPPConnection conn = new XMPPConnection(“ispa0012”,5222);

conn.login(“gforty”,“password”);

System.out.println(“LOGGED IN”+conn.getUser());

MultiUserChat muc = new MultiUserChat(conn, “aroom”+CONFERENCE_SERVICE_NAME);

System.out.println(“MUC NAME=”*muc.getRoom());//*THIS WORKS+

Form form = muc.getConfigurationForm(); //THIS IS WHERE IT ERRORS OUT

System.out.println(form.toString());

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

{

FormField field = (FormField) fields.next();

System.out.println("FIELD=“field.getVariable()” and its value equals "+field.getType());

Iterator it = field.getValues();

while(it.hasNext())

{

System.out.println(“VALUE=”+it.next());

}

}

}

/code

The error is as follows:

No response from server.:

org.jivesoftware.smackx.muc.MultiUserChat.getConfigurationForm(MultiUserCha t.java:523)

chatPackage.MUC.getRoomParms(MUC.java:298)

org.apache.jsp.try2_jsp._jspService(try2_jsp.java:54)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java: 322)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilte r.java:362)

This is the same error I am getting from the getOwners() method call.

I am using smack 2.2.1 dated June 12 , 2006…

Message was edited by: gforty

Has anybody been successful at retrieving the RoomOwner?

Message was edited by: gforty

Hey gforty,

After creating a new MultiUserChat and before requesting its owners you need to join the room. Use #join(String nickname) or any of the other #joins messages available. We probably need to enhance Smack to throw an IllegalStateException if you try to use a MultiUserChat before actually joining a room.

Regards,

– Gato

Thanks Gato.

I should have known that as I believe that was the answer to one of my other posts.

What I am trying to do is:

I have a web based app. I currently iterate through the list of rooms and print out.

I wanted to return the owner(in my case only 1 per room) and compare this to the user session…if these match I want to display an image that gives them the option of deleting the room.

If I have to join each room to return the owner, how expensive is this on the server if every connection(user) will join room->query owner>leave room every n seconds.?

I looked , hoping that this was availabe through the ServiceDiscoveryManager, but it wasnt.

Thanks!