users@glassfish.java.net

Re: Enable Session Memory Replication

From: Larry White <Larry.White_at_Sun.COM>
Date: Mon, 11 Feb 2008 10:24:40 -0800

Hi Ryan:

When difficulties like this arise, we generally recommend that people
validate their environment by using the sample app clusterjsp.

This app works for us reproducibly. So a good first step is to ensure
it is working in your environment.

One thing I noticed in your writeup that is potentially problematic is
this (that you wrote):

After deploying the application to the cluster, I check the
"Availability" check box in the admin console and save. This is
supposed to enable in-memory session replication, right?

When you deploy or re-deploy an app, as part of the loading process it
checks
for correct configuration and then if all is well, your runtime
deployment will be
usinga replication-aware manager. Once the app is already deployed and is
non-replicating, simply changing the value of the availability-enabled
without undeploying
and redeploying will have no positive effect. So I was wondering if
that is your
problem.

Once your app is loading as replication enabled you should see messages
in the
server.log showing jxta pipes being connected. If you are not seeing
that then
there is still something wrong with your configuration.

Asleson, Ryan wrote:

>I do have the <distributable /> tag in web.xml. Also, the sun-web.xml
>looks like what appears below. Is there anything else to check? I saw
>some errors in the log about items not being serializable, but I fixed
>those yet the memory replication doesn't appear to be working.
>
>Is there a way to know if the session replication is even being
>attempted?
>
>
>
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application
>Server 9.0 Servlet 2.5//EN"
>"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
><sun-web-app error-url="">
> <session-config>
> <session-manager persistence-type="replicated">
> <manager-properties>
> <property name="persistenceFrequency"
>value="web-method"/>
> </manager-properties>
> <store-properties>
> <property name="persistenceScope" value="session"/>
> </store-properties>
> </session-manager>
> <session-properties/>
> <cookie-properties/>
> </session-config>
></sun-web-app>
>
>
>
>
>-----Original Message-----
>From: Peter.Fabian_at_Sun.COM [mailto:Peter.Fabian_at_Sun.COM]
>Sent: Friday, February 08, 2008 3:38 PM
>To: users_at_glassfish.dev.java.net
>Subject: Re: Enable Session Memory Replication
>
>Asleson, Ryan wrote:
>
>
>>
>>Hello,
>>
>>I have successfully created a clustered Glassfish development
>>environment using the instructions found here:
>>
>>https://glassfish.dev.java.net/javaee5/build/GlassFish_LB_Cluster.html
>>
>>I have 3 computers: One running the Sun web server with the load
>>balancer plugin, one computer running a server instance, and one
>>computer running a server instance and that also acts as the DAS.
>>
>>I created an application that stores data in session. I can use the
>>application and see that both instances in the cluster are being used.
>>
>>I start some work on instance1. Then, I shut down instance1. Next, I
>>
>>
>
>
>
>>return to the application and go to the next page. I can see that
>>instance2 is being used (which is correct, since instance1 was shut
>>down) however none of the session data appears.
>>
>>After deploying the application to the cluster, I check the
>>"Availability" check box in the admin console and save. This is
>>supposed to enable in-memory session replication, right?
>>
>>
>>
>The web-app element of the web.xml deployment descriptor file must
>contain the distributable element.
>http://docs.sun.com/app/docs/doc/819-3679/abdkz?a=view
>
>
>
>
>