powered by Jive Software

Problem with domains

I have a problem with connecting to an intranet Jabberd server with Smack.

The server’'s local name is X.local, its external name and hostname are X.com.

When I try to login using X.local I see the following transcript:

Sent:

[/i]

Received:

<?xml version=''1.0''?>

stream:errorDisconnected</stream:error></stream:stream>[/i]

And in the Jabberd error log the message:

bouncing a routed packet to yossi@X.local from 16@c2s/A162BD8: Internal Delivery Error[/i]

When I add a /etc/hosts entry for X.com on the client and try to connect using X.com, everything works.

so then what is the issue?

The issue is that login to the server fails, and the work around of adding the /etc/hosts line is not acceptable because this is not the “real” address of X.com.

Using clients such as Gaim I have no problem to connect to the server, by using the “Connect Server” property to set the internal name of host. This should be possible using Smack too, and from what I saw it is supposed to work (Smack uses the JID it gets back from the server), but it does not work in my case.

It probably would be a good thing in your situation if you could specify the hostname seperatly from the jabber server name. I have the same network setup as you but dont experience the same issue with Jive Messenger.

my recommendation to you is to overwrite XMPPConnection(host, port) make it something like XMPPConnection(serverName, host, port) which really wouldn’‘t work though now that I look at it because init() is private so you wouldn’‘t be able to access it from your created class. You can go through init if you like and see if there are any private method’'s called but any protected methods you would have to override also with a call to super so this hack might get complicated rather quickly Maybe its quicker to just hope for a fix.

It sounds like Jabberd is not acting the way it perhaps should. The code in PacketReader of Smack does:

// Use the server name that the server says that it is.

connection.host = parser.getAttributeValue(i);

So, the server won’‘t report back it’'s proper name and instead just throws an error.

Any chance you could use a different server like Jive Messenger?

-Matt

Hi Matt,

I knew that Smack was supposed to do this, but it doesn’‘t seem to work, at least in my case. Seems to me Jabberd is one of the most commenly used XMPP servers, isn’'t it?

The reason I am not using Jive is that I need transport support, how far along is Jive there?

Anyway, I will need to support customers with Jabberd…

I knew that Smack was supposed to do this, but it

doesn’'t seem to work, at least in my case.

It doesn’‘t work because the server doesn’‘t let it. Maybe there’‘s a config change in Jabberd that would let it work. Otherwise, you’'d have to change Smack as suggested above.

Seems to

me Jabberd is one of the most commenly used XMPP

servers, isn’'t it?

Definitely true, but it’'s not the best server anymore IMHO.

The reason I am not using Jive is that I need

transport support, how far along is Jive there?

Anyway, I will need to support customers with

Jabberd…

Transports are working well with Jive Messenger now (the Py* transports).

Regards,

Matt

I am new to using smack, and for that matter, Jabber. I am having similar problems where I am trying to create a client to connect to Google’'s jabber server. The server name is talk.google.com but the user domain is user@gmail.com

There doesn’‘t appear to be a way in smack to get around this. The workaround I tried was to pass a SocketFactory to XMPPConnection that will create a socket to the servername, but still use the domain name as the host parameter. That doesn’'t seem to get around it. Does anyone have any suggestions?

The progress of getting smack to connect to google will be updated here:

http://www.jivesoftware.org/forums/thread.jspa?threadID=15578&tstart=0