powered by Jive Software

Timeout on all servers

Hi, when I try to join a chat like this:

XMPPConnection conn = new XMPPConnection(“jabber.org”);

conn.getAccountManager().createAccount(“testAcc”, “-”);

conn.login(testAcc, “-”);

MultiUserChat c = new MultiUserChat(conn, "testRoom123@jabber.org");

c.join(“testAcc”, null, null, 100000);

I get a timeout exeption on the join line. I’'ve also tried with some other servers, but it gives me the same exception.

It works fine when just chatting with no groups.

What server are you using? Was the room already created? Open up the smack debugger and post what is in raw sent packets and raw received packets.

Alex

As you see in the code, i’‘m using the jabber.org server, I’'ve also tried with jabber.dk, it gives the same error.

Here are the sent packages:



I can’'t see directly from these what the problem might be.

Btw, it’‘s realy a cool debugger you’'ve got!

Hey Thomas,

Make sure that you are using the MultiUserChat service when joining/creating a room. In your example I see new MultiUserChat(conn, "testRoom123@jabber.org");[/i] and it should be new MultiUserChat(conn, “testRoom123@conference.jabber.org”);[/i].

Same applies for this case: replace

[/i] with

[/i].

Hope that helps.

Regards,

– Gato

Thanks, does all servers have a conference subdomain?

Uhm, now I get this package

How do I handle that?

Hey Thomas,

but in practice servers tend to use conference.

In theory the name of the MUC service does not have to be conference. for their MUC service.

In the url=http://www.jivesoftware.org/builds/smack/docs/latest/documentation/extension s/muc.htmlMUC documentation[/url] you will find information and code snippet that shows how to create new rooms.

Note: Remove the empty space in the last word of the link.

Regards,

– Gato

I use service discovery to search for the multi-user chat service on the server. This has the added benefit of not having to hardcode the appropriate subdomain. The downside is more stanzas to get what you are looking for, but unless you are creating a low-bandwidth client this overhead is mostly negligible.

Alex,

You are correct. Clients should use disco to discover the MUC service address instead of hard coding it.

Regards,

– Gato

Uhm what widespace?

And how to unlock the room?

And how do I use this doscovery service?

Sorry ignore my last post. The muc doc is very good.

My problem just is, that when I do: muc.create(“name”); I get a ClassCastException.

at org.jivesoftware.smackx.muc.MultiUserChat.getMUCUserExtension(MultiUserChat.jav a:1900)

at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:313)

at smacktest.Main.(Main.java:43)

Smack creates a Presence: Presence presence = (Presence) response.nextResult(SmackConfiguration.getPacketReplyTimeout());

and then it tries to cast it into a MUCUser: return (MUCUser) packet.getExtension(“x”, “http://jabber.org/protocol/muc#user”);

Is this a smack but, or have I done something wrong?

Hey Thomas,

You can search on this forum for answers to the ClassCastException problem. In short, the problem is that the file META-INF/smack.providers is not being located. You shouldn’'t be having this problem if you are using the provided smack.jar and smackx.jar files. If you are building your own jar files then make sure that the META-INF folder is present in your classpath.

Regards,

– Gato