powered by Jive Software

HTTP binding problem with JSJaC library example application

Hello,

I would like to try out HTTP Binding with the JSJaC library (JSJaC - JavaScript Jabber Client Library http://zeank.in-berlin.de/jsjac/). I use Windows XP, Apache 2.0.61, Openfire 3.3.3, JSJaC 1.2.1.

Inside my virtualhost definition I have the following lines:

RewriteEngine On

RewriteRule ^http-bind http://localhost:8080/http-bind/

Note: “^/http-bind” as mentioned in JSJaC README file did not work for me (perhaps because of Windows).

Just for the record I also needed to enable the following modules in httpd.conf:

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule rewrite_module modules/mod_rewrite.so

I just checked apache log, and corrected the configuration until it worked.

This is how it should work as I figured it out from http://www.igniterealtime.org/community/message/138377 and

http://chromus.kajigger.com/blog/2007/03/22/making-jwchat-work-with-openfire/ .

Then I set the “HTTP Base” to “http://localhost/http-bind” in the JSJac Simple Client, and fill in the other fields as well.

When I try to log in I see “initial response broken (status: 400)” in the FireBug console. If I set “HTTP Base” to “http://localhost/http-bind/” the same problem happens.

Before that there is the post in the firebug console:

POST http://localhost/http-bind400 (31ms)

Headers:

Response Headers

Date Mon, 15 Oct 2007 19:12:52 GMT

Server Jetty(6.1.x)

Content-Type text/html; charset=iso-8859-1

Content-Length 1389

Connection close

Request Headers

Host localhost

User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7

Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/p lain;q=0.8,image/png,/;q=0.5

Accept-Language en-us,en;q=0.5

Accept-Encoding gzip,deflate

Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive 300

Connection keep-alive

Content-Type text/xml; charset=utf-8

Referer http://localhost/jsjac-1.2.1/examples/simpleclient.html

Content-Length 206

Cookie JSESSIONID=1gtschlix40iz

Pragma no-cache

Cache-Control no-cache

Post:

What is the problem? Should I include openfire logs as well?

avangel wrote:

Then I set the “HTTP Base” to “http://localhost/http-bind” in the JSJac Simple Client, and fill in the other fields as well.

I use the proxy module in Apache, but your “HTTP Base” needs to read “/http-bind” only (for the proxy you need the finishing slash, maybe here too).

Thanks for the answer, I tried that, but that does not solve the problem. Apparently the first parameter in RewriteRule is a regular expression, see documentation (http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule), so if you use the finishing slash in RewriteRule, you should use it also in the “HTTP Base”. But OK, let’s use it, as it is used in the examples. If you use “/http-bind/” or “http://localhost/http-bind/” for “HTTP Base” does not really matter: both will generate a post to http://localhost/http-bind/ according to the FireBug console.

I checked also openfire logs, and warn.log contains a line:

2007.10.16 14:54:13 Error parsing user request. http://127.0.0.1

So it seems that JSJac 1.2.1 and Openfire 3.3.3. I don’t know whether Openfire has a bug parsing the request or JSJaC violates the standard. One could study the standard, compile Openfire from source and track down what causes this problem. But for now I would leave it for the experts.

I am having this very same problem with OpenFire 3.50, I added the actual parser exception to the log and I got “org.xmlpull.v1.XmlPullParserException: could not determine namespace bound to attribute prefix xmpp”. I just posted another issue with this, but this thread should also be bumped if we’re having the same problem.

Maybe someone already figured this one out, if so please post your solution…

I want to ask that my jsjac with the HttpBinding is not stability often.

I often login in the jwchat failure!How can i do to handle this problem.

Thanks!

clover

use port 7443