powered by Jive Software


public static Collection getHostedRooms(XMPPConnection connection,

String serviceName)

throws XMPPException

pls, what goes under “serviceName”? name of server, it would seem to me, but this isn’‘t working… since it doesn’‘t say ‘‘name of server’’ I assume it’'s not name of server but sthg else…

I have:

try {

Collection rooms = conn.getHostedRooms(conn, “”);

} catch (XMPPException e) {

System.out.println("Exception Caught: " + e.getMessage() + " " + e);



but get ‘‘cannot find symbol’’ error on var ‘‘rooms’’…

(searched for ‘‘getHostedRooms’’ in documentation, found nothing… )

thank you…

It would be the hosting Multi user chat server, on my server it is “conference.server.com”.

i.e., name of server, right? (I even put ‘‘jabber.org’’… it isn’'t working…)

or is ‘‘conference’’ here not part of name of server?

I’‘m new at this… just created one room yesterday, want to see if it’'s there…

(in my app will need to create new rooms on the fly, find out if they exist first…)

thank you very much…

I am not sure what it is but it might be conference.jabber.org or muconference.jabber.org you can search for the name of the muc server in disco.

ok, thank you very much… still get error…

cannot find symbol : method getHostedRooms(org.jivesoftware.smack.XMPPConnection,java.lang.


location: class org.jivesoftware.smack.XMPPConnection

Collection rooms = conn.getHostedRooms(conn, “conference.jabber.org”);

I may have syntax wrong… they’'re a bit vague in the docs, as to syntax…

under ‘‘service’’ in docs for this method it says: “the service that is hosting the rooms to discover.”

does ‘‘service’’ include name of server or not? (I assume this can only be done if already connected to a a server and can only search for rooms in that server? or do you still have to specify name of server?)

what is “conference”?? all servers have GroupChatRooms in a separate “sub-domain”?

thank very much…

yes, all servers have muchats in a seperate sub-domain which is why you are specifying it as “conference.jabber.org” The error you are having looks like a class-path issue make sure the smackx package is on your class path.

thank you very much for your help…

can’‘t be a classpath error (since I’‘m using MUC to create room… don’'t get any errors there…( newGroupChat = new MultiUserChat(conn, theRoom)…)

again, many thanks…

i see the problem… the method is:

MultiUserChat.getHostedRooms(conn, “conference.jivesoftware.org”);


You are calling it on the wrong class.

http://www.jivesoftware.org/builds/smack/docs/latest/javadoc/org/jivesoftware/sm ackx/muc/MultiUserChat.html#getHostedRooms(org.jivesoftware.smack.XMPPConnection, java.lang.String)

yes, you’‘re absolutely right… and the reason I was getting errors on that ‘‘rooms’’ var (system.out.println(rooms)) is that this var was decl’'d inside try-block… thank you and everyone else very much…