voyent
Session expiring prematurely  XML
Forum Index -> Async HTTP Server Go to Page: 1, 2 Next 
Author Message
shauii

Joined: 29/Oct/2007 00:00:00
Messages: 15
Offline


Hi,

Can you help me out with session expiry? My icefaces application is expiring prematurely. My environment is:
Jboss AS 4.2.2GA
Icefaces 1.7.0 RC1
Apache HTTP Server 2.2

The web.xml is configured as:

Code:
 <!-- for AHS-->
   <context-param>
     <param-name>com.icesoft.faces.blockingRequestHandler</param-name>
     <param-value>icefaces-ahs</param-value>
   </context-param>
 	
   <context-param>
     <param-name>com.icesoft.faces.blockingRequestHandlerContext</param-name>
     <param-value>async-http-server</param-value>
   </context-param>
 	
   <context-param>
     <param-name>com.icesoft.net.messaging.properties</param-name>
     <param-value>jboss.properties</param-value>
   </context-param>
   <!-- END for AHS -->
   
   <context-param>
     <param-name>com.icesoft.faces.heartbeatInterval</param-name>
     <param-value>60000</param-value>
   </context-param>
   <context-param>
     <param-name>com.icesoft.faces.heartbeatTimeout</param-name>
     <param-value>60000</param-value>
   </context-param>
   <context-param>
     <param-name>com.icesoft.faces.heartbeatRetries</param-name>
     <param-value>1000</param-value>
   </context-param>
   <context-param>
     <param-name>com.icesoft.faces.connectionTimeout</param-name>
     <param-value>600000</param-value>
   </context-param>


What happens is that the session expires at around 2 minutes. When it expires it doesn't display the "User session expired" pop-up. The user won't know that the session has already expired unless he clicks on the page.

The icefaces console doesn't close but shows this:
Code:
[window.RFfD#1.async-connection.ui] : [8894230] : send asynchronous POST
 [window.RFfD#1.async-connection.ui] : [8894230] : receive [200] OK
 [window.RFfD#1] : Session has expired
 [window.RFfD#1.async-connection.heartbeat] : heartbeat stopped
 [window.RFfD#1.async-connection.blocking] : [8668774] : connection closed
 [window.RFfD#1.async-connection] : receive broadcast failed[object Error]
 [window.RFfD#1.async-connection.ui] : [8894230] : connection closed
 [window.RFfD#1.async-connection.heartbeat] : heartbeat started
 [window.RFfD#1.async-connection] : closing previous connection...
 [window.RFfD#1.async-connection] : connect...
 [window.RFfD#1.async-connection.blocking] : [8750775] : send asynchronous POST
 [window.RFfD#1.async-connection.blocking] : [8750775] : receive [404] Not Found


I would want the connection to stay for around 10-20 mins as I have some transaction processing that would take that much time. Appreciate the help.
jack.van.ooststroom


Joined: 26/Oct/2004 00:00:00
Messages: 223
Offline


Hi,

Did you deploy the separate async-http-server.war to your JBoss AS as well? If so, how is it configured (servlet-mode vs. server-mode, properties file)?

Regards,

Jack van Ooststroom
Senior Developer
ICEsoft Technologies, Inc.
[Email]
shauii

Joined: 29/Oct/2007 00:00:00
Messages: 15
Offline


Hi,

Yes. I do have the async-http-server.war deployed on the JBossHome\server\default\deploy folder. I didn't place the configuration for servlet-mode since I've read from the dev guide that the default configuration is servlet-mode and that's the mode I wanted to use. My web.xml configurations for AHS are:

Code:
<!-- for AHS-->
    <context-param>
      <param-name>com.icesoft.faces.blockingRequestHandler</param-name>
      <param-value>icefaces-ahs</param-value>
    </context-param>
  	
    <context-param>
      <param-name>com.icesoft.faces.blockingRequestHandlerContext</param-name>
      <param-value>async-http-server</param-value>
    </context-param>
  	
    <context-param>
      <param-name>com.icesoft.net.messaging.properties</param-name>
      <param-value>jboss.properties</param-value>
    </context-param>
    <!-- END for AHS -->


Oh, and I'd add like to add that my session timeout is:

Code:
  <session-config>
     <session-timeout>60</session-timeout>
   </session-config>


Thanks!
jack.van.ooststroom


Joined: 26/Oct/2004 00:00:00
Messages: 223
Offline


Hi,

The next thing we should check is the Apache configuration part that proxy passes the ICEfaces application related requests. Can you post your Apache configuration file or the snippet (preferably the VirtualHost directive containing the ProxyPass and ProxyPassReverse directives) that deals with this?

Regards,

Jack van Ooststroom
Senior Developer
ICEsoft Technologies, Inc.
[Email]
shauii

Joined: 29/Oct/2007 00:00:00
Messages: 15
Offline


Hi,

I'm using mod_jk.so plugin. I didn't place the ProxyPass and ProxyPassReverse since the Dev Guide mentioned that they can be omitted if the plug-in is used.

Here are the changes I've added to httpd.conf:

Code:
LoadModule proxy_module modules/mod_proxy.so
 LoadModule proxy_http_module modules/mod_proxy_http.so


and

Code:
 # Include mod_jk configuration file
 Include conf/mod-jk.conf
 
 <VirtualHost _default_>
         ServerAdmin webmaster@host.example.com
         #DocumentRoot /var/www/html/host.example.com
         ServerName localhost
         ErrorLog logs/ra-error_log
         TransferLog logs/ra-access_log
         <IfModule mod_proxy.c>
             ProxyRequests Off
             <Proxy *>
                 Order deny,allow
                 Allow from all
             </Proxy>
      </IfModule>
 </VirtualHost>


I am also attaching my httpd.conf here. Thanks!
 Filename httpd.conf [Disk] Download
 Description httpd.conf file
 Filesize 18 Kbytes
 Downloaded:  481 time(s)

jack.van.ooststroom


Joined: 26/Oct/2004 00:00:00
Messages: 223
Offline


Hi,

Just for completeness, can you post your mod-jk.conf as well?

Regards,

Jack van Ooststroom
Senior Developer
ICEsoft Technologies, Inc.
[Email]
shauii

Joined: 29/Oct/2007 00:00:00
Messages: 15
Offline


Sure. Please find my mod-jk.conf attached.

I have also attached my workers.properties file for your perusal. Thanks!
 Filename mod-jk.conf [Disk] Download
 Description
 Filesize 1 Kbytes
 Downloaded:  413 time(s)

 Filename workers.properties [Disk] Download
 Description
 Filesize 795 bytes
 Downloaded:  331 time(s)

jack.van.ooststroom


Joined: 26/Oct/2004 00:00:00
Messages: 223
Offline


Your worker.properties file has two nodes defined to be running as a cluster, namely node1 and node2. However, both nodes are configured to be running on the same host (localhost) and port (8009). However, you're using the default server from JBoss (thus not the clustered version). What is your desired environment: clustered or non-clustered?

As you're using Apache 2.2.x, what is the reason to use mod_jk?

Regards,

Jack van Ooststroom
Senior Developer
ICEsoft Technologies, Inc.
[Email]
shauii

Joined: 29/Oct/2007 00:00:00
Messages: 15
Offline


Hi,

I wanted to front my JBoss with Apache and just followed the wiki http://wiki.jboss.org/wiki/UsingMod_jk1.2WithJBoss. When it was working fine with AHS, I just left it as it is. Now, I've also tried using mod_proxy (thanks for pointing me to that direction) and my application is up and running with AHS. However, I still have the same session problem.

I am attaching my modified httpd.conf and I've also deleted the mod-jk.so in the apache/modules directory to make sure that I'm no longer using it.

I have also tried accessing my application from JBoss on port 8080. I am also getting the same session expiry problem. One difference though is that when the session expires with Apache http server, I don't get the User Session expiry pop-up until I clicked on a component. When accessing from JBoss port 8080, User Session expiry pops up promptly at around 2 minutes inactivity.
 Filename httpd.conf [Disk] Download
 Description
 Filesize 18 Kbytes
 Downloaded:  374 time(s)

jack.van.ooststroom


Joined: 26/Oct/2004 00:00:00
Messages: 223
Offline


Hello,

Sorry for the wait. We've been really busy trying to get the 1.7 release out the door.

Anyways, as you're running AHS in Servlet mode your httpd.conf can be simplified a bit to resolve the issue you're seeing. You currently have the following in your http.conf:

Code:
    ProxyPass        /ra/block/receive-updated-views http://localhost:51315/ra/block/receive-updated-views
    ProxyPassReverse /ra/block/receive-updated-views http://localhost:51315/ra/block/receive-updated-views

When AHS is running in Servlet-mode it is not occupying an additional port, but it's rather using the application server's port 8080. Please replace the above to directives with the following:

Code:
    ProxyPass        /async-http-server ajp://localhost:8009/async-http-server
    ProxyPassReverse /async-http-server ajp://localhost:8009/async-http-server

However, I'm surprised to see that your test of directly going to port 8080 failed as well. An advantage of AHS running as a Servlet is that a web server as a front-end isn't required. Can you capture the HTTP Responses that are being send back with the 404 status-code as mentioned in the JavaScript console. If you're unfamiliar with capturing HTTP traffic I can help you out with that, depending on the browser and OS you use.

Regards,


Jack van Ooststroom
Senior Developer
ICEsoft Technologies, Inc.
[Email]
shauii

Joined: 29/Oct/2007 00:00:00
Messages: 15
Offline


Hi,

I've changed my httpd.conf as you've suggested. One thing that changed is that the pop-up comes now both when using the HTTP server and when using port 8080. I am not sure how to capture the HTTP responses that you've mentioned. Please do help me with that. I am attaching the ra-access.log here though.

I'll just paste the error.log here since it's just two lines.

Code:
[Thu Apr 17 11:01:07 2008] [error] ajp_read_header: ajp_ilink_receive failed
 [Thu Apr 17 11:01:07 2008] [error] (120006)APR does not understand this error code: proxy: read response failed from 127.0.0.1:8009 (localhost)


Thanks for the help!
 Filename ra-access.log [Disk] Download
 Description
 Filesize 10 Kbytes
 Downloaded:  496 time(s)

jack.van.ooststroom


Joined: 26/Oct/2004 00:00:00
Messages: 223
Offline


As going directly to port 8080 fails as well, we'd better have a look at your application's configuration and/or your application itself first. Would it be possible to post you application or your application's configuration (web.xml) or otherwise e-mail it to product.support@icesoft.com? If you want to e-mail it please include in your e-mail that it's intended for me.

Regards,

Jack van Ooststroom
Senior Developer
ICEsoft Technologies, Inc.
[Email]
shauii

Joined: 29/Oct/2007 00:00:00
Messages: 15
Offline


Hi,

I've sent a war file to the email you've provided. Hopefully you'll still be able to recreate the error since I've removed some codes for database support.


Thanks!
jack.van.ooststroom


Joined: 26/Oct/2004 00:00:00
Messages: 223
Offline


Hello,

I received your war-file, but I've been unable to reproduce the issue so far. After downloading a couple of missing libraries and adding them to you war-file, I'm now at the point that it's complaining about a JDBC driver not being available. I ignored this exception as I do not have the database anyways. However, when trying to access the application I got the following NoClassDefFoundError:

Code:
java.lang.NoClassDefFoundError
 	com.common.audit.dao.DpmsgrepoHome.getSession(DpmsgrepoHome.java:44)
        ...

Is there any other library that I'm missing?

In the meantime, could you do another test by removing the AHS-specific configurations from your ICEfaces application's web.xml, remove the icefaces-ahs.jar from your ICEfaces application, undeploy AHS as well and see if you're running into the same issue? The AHS-specific configurations I'm referring to are:

Code:
   <context-param>
     <param-name>com.icesoft.faces.blockingRequestHandler</param-name>
     <param-value>icefaces-ahs</param-value>
   </context-param>
   <context-param>
     <param-name>com.icesoft.faces.blockingRequestHandlerContext</param-name>
     <param-value>async-http-server</param-value>
   </context-param>
   <context-param>
     <param-name>com.icesoft.net.messaging.properties</param-name>
     <param-value>jboss.properties</param-value>
   </context-param>

Regards,

Jack van Ooststroom
Senior Developer
ICEsoft Technologies, Inc.
[Email]
shauii

Joined: 29/Oct/2007 00:00:00
Messages: 15
Offline


Hi,

Sorry, it seems I still wasn't able to clean up the code properly. I think it came from an AspectJ class that I wasn't able to remove. I can still send you a new war file if you're still willing to accept it though.

I have also tried undeploying AHS as you've mentioned and the session problem occurs with or without AHS. Could there be some workaround for this? Something like pinging the server from the screen itself?

Many thanks,

 
Forum Index -> Async HTTP Server Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team