users@glassfish.java.net

Running GlassFish with mod_proxy

From: <glassfish_at_javadesktop.org>
Date: Fri, 27 Jun 2008 01:36:21 PDT

Hi,
I am writing a WebChat system using HTTP streaming by reference to
http://docs.sun.com/app/docs/doc/820-4496/ggrgy

The application have to close the XMPP connection when the browser reloaded or exit.
So, I had created the CometHandler like below.

MyCometHandler:
    public void onTerminate(CometEvent event) throws IOException {
        onInterrupt(event);
    }
    public void onInterrupt(CometEvent event) throws IOException {
        logger.info("close");
        writer.close();
        event.getCometContext().removeCometHandler(this);
        // XMPP Connection close
        ....
    }

I accessed the glassfish directly, it worked fine,
and the onInterrupt method is called immediately.

So, I try to access the glassfish through the apache mod_proxy.
that followed the instruction in
http://forums.java.net/jive/thread.jspa?messageID=276500

The application works fine.
but I realize the onInterrupt method isn't called in spite of the browser exit.
It called after timeout. I want to call it immediately.

My test environment is:
・GlassFish v3 TP2
・Apach httpd(mod_proxy) 2.2.9
・Windows XP

My mod_proxy configuration in httpd.conf is:
<VirtualHost *:80>
 <Location ...>
    ProxyPass http://localhost:8080/webchat/
    ProxyPassReverse http://localhost:8080/webchat/
 </Location>
</VirtualHost>

If anyone resolved this problem, please tell me the solution.
Thanks!
[Message sent by forum member 'kzri' (kzri)]

http://forums.java.net/jive/thread.jspa?messageID=282916