JwChat and Wildfire giving HTTP 401 Error

Okay I know I’‘ve just posted not long ago, but I’'ve found another problem I was hoping to get ideas from.

I’‘m not entirely sure if this is a Wildfire problem or a Jwchat problem, however, I’'m posting over at the JwChat forums as well. My gut tells me its Jwchat but it could be anything.

My problem is that I cannot connect to the Wildfire server with JwChat after we updated our DNS with an address that made it easier to refer to the jabber server from inside and outside of the office.

I’'m currently running Wildfire 2.6.2 and JwChat 1.0 Beta 2 on Tomcat 5.5.17. Prior to the updating of the DNS, we used the actual host name of the server to reference the wildfire server, in this case “kiwinet”. We also called the wildfire server “kiwinet”. Today we updated the DNS such that we could access the wildfire server outside of the firewall using a single address “kiwiim.myserver.com” which is just an alias for kiwinet. We also updated the name of wildfire to “kiwiim.myserver.com” for consistency, and therefore updated the RSA and DSA certificates in the keystore on wildfire. Also note that the keystore of wildfire is the same keystore used for tomcat.

Anyway prior to the change everything worked perfectly with JwChat and Wildfire. However with the change over and renaming of the wildfire server, I now cannot log on to the server at all. That is I can get the Jwchat login page, and I enter my details. It brings up the buddy list window, but doesn’'t get any further, instead saying “Internal Server Error” with the debug log:

"[Wed 29 Mar 2006 02:42:15 PM PST] (level 4) func: JSJaCSendQueue

sending:

(level 4) func: unknown

async recv:

(level 3) func: JSJaCHandleResponse

xmldoc.firstChild.childNodes.length: 0

(level 4) func: unknown

async recv: <!H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font- size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font- size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font- size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12p x;}A A.name HR >h1. HTTP Status 401 -



type

Status report


message


description

This request requires HTTP authentication ().


h3. Apache Tomcat/5.5.9

(level 1) func: JSJaCHBCPrepareResponse

invalid response: <!H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font- size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font- size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font- size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12p x;}A A.name HR >h1. HTTP Status 401 -



type

Status report


message


description

This request requires HTTP authentication ().


h3. Apache Tomcat/5.5.9

(level 1) func: JSJaCHBCPrepareResponse

Disconnected.

(level 3) func: unknown

incoming event ‘‘ondisconnect’’

(level 2) func: unknown

handling event ‘‘ondisconnect’’

(level 3) func: unknown

incoming event ‘‘onerror’’

(level 2) func: unknown

handling event ‘‘onerror’’

(level 1) func: JSJaCSendQueue

Connection lost …

(level 1) func: JSJaCSendQueue

Connection lost …

(level 2) func: JSJaCHBCDisconnect

Disconnected:

(level 3) func: unknown

incoming event ‘‘ondisconnect’’

(level 2) func: unknown

handling event ‘‘ondisconnect’’ " /i

However[/b], I created another jwchat web server on another computer and it connected fine to the wildfire server, with no problems at all! I also tested the Jwchat over at www.jwchat.org, and again this connected to my wildfire server prefectly fine: So I am extremely confused. I googled this in hope of finding some information and found this post at the jwchat forums:

"(https://sourceforge.net/forum/message.php?msg_id=3659289)

I’‘ve got a similar setup and have seen this 401 when I’'ve set Wildfire to listen on a specific IP address. But I get the 401 when trying to login so it never gets any further. Allowing wildfire to listen on all IP addresses fixes it.

I know this probably doesn’'t help you But it might make someone realise what the problem is. /i"

I’'ve checked my wildfire.xml config file that the wildfire server was checking all interfaces, and it is. I even restored a previous config file to the same avail.

On top of that I’'ve deleting the tomcat server and placing a fresh install on, and deleted the jwchat files and replaced with a fresh install. Both made absolutely no difference.

If I try to connect to the wildfire server by just going to the machine by IP address or its host name, I get an error also stating

"An Error Occured:

Code: 400

Type: modify

Condition: bad-request" (there is no debug log for this)

I’‘ve tried everything I can think of. I’‘m extremely confused since any other jwchat will happily connect to the server by its alias “kiwiim.myserver.com”, except for the one sitting on the same server as the wildfire server. Which is obviously the one that we want. I think that its a network issue regarding the alias, however, I’'m not entirely sure…

Thank you for these great forums, they’'ve helped me so much.

Hi,

Maybe you can try to edit the hosts file (/etc/hosts for unix, %windir%\system32\drivers\etc\hosts for windows) and add a line:

127.0.0.1 kiwiim.myserver.com conference.kiwiim.myserver.com

to make sure that JWChat tries to connect to 127.0.0.1:5222. You must restart Tomcat (or wait until the java dns cache expires) after changing the hosts file.

I hope that this helps, maybe it helps to exchange 127.0.0.1 with your LAN address.

LG

PS: I wonder how your rosters can show up normal, your buddies should all have JID’'s like user@kiwinet instead of user@kiwiim.myserver.com so you should probably edit the JIVEROSTER table.

Wow! once again these forums have been a huge help! Your host file fix worked like a charm.

With regard to your final comment, my server uses LDAP for authentication, does this mean I still need to to change my database? As far as I can see all the rosters seem to populate happily… but if this might cause problems in the future then I better change it, since it is currently undergoing testing and will be rolled out for actual use within the next few weeks.

Thanks again!

Hi,

probably the server is still able to resolve kiwinet as its own address or/and you did disable the server-to-server option. This would explain why it runs fine.

Also Gato did post “A common mistake when adding users to the contact list is to NOT use the server name but something else like an IP address. So if you server name is myexample.com then make sure that you add users of the form john@myexample.com and not john@something.com. Otherwise the server will assume that something.com refers to a remote server and will try to establish a server-to-server connection.” in http://www.jivesoftware.org/community/thread.jspa?threadID=19894

As long as the server and your internal clients are able to resolve kiwinet they may still use “user@kiwinet” to connect to the server and to add JIDs, but it is not a supported or recommended configuration. You probably also need to tell your internal users to stop using “@kiwinet” and switch over to "@kiwiim.xx.com" - this will likely be the harder task than changing the roster table.

LG