掲示板

Portlet session attribute null in Cluster

thumbnail
13年前 に Sandeep Nair によって更新されました。

Portlet session attribute null in Cluster

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Hi,

I am having two tomcat clustered, load balanced and session replication is also working. I have seen that sometimes when i am trying to retrieve value from portletsession it returns null. It works if i refresh the thing again. This happens intermittently.

It doesnt happen for the same application with just one tomcat. I feel its because it takes some time for session replication.

Regards,
Sandeep
thumbnail
13年前 に Sandeep Nair によって更新されました。

RE: Portlet session attribute null in Cluster

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
It seems attributes set in portletSession is not replicated in other nodes. I have configured session replication in tomcat. i have tested the same by stoping one of the nodes and user is not logged out, he is just switched over to the other node. But i think it may be problem with portlet session that it doesnt replicate the attributes set in portletsession.

Is anyone facing the same problem?

Regards,
Sandeep
thumbnail
13年前 に Sandeep Nair によって更新されました。

RE: Portlet session attribute null in Cluster

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Has anyone faced this problem. Its happening in Lifeary 6 EE
thumbnail
13年前 に Minhchau Dang によって更新されました。

RE: Portlet session attribute null in Cluster

Liferay Master 投稿: 598 参加年月日: 07/10/22 最新の投稿
Sandeep Nair:
I feel its because it takes some time for session replication.

Are you using synchronous session replication or asynchronous session replication? I believe the default for Tomcat is asynchronous, so the behavior you are seeing is expected. You will need to double check the Tomcat documentation to force the replication to be synchronous in order to address your problem.
thumbnail
13年前 に Sandeep Nair によって更新されました。

RE: Portlet session attribute null in Cluster

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Thanks for the reply Minhchau. I have added the following in both nodes' server.xml

       <cluster classname="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelsendoptions="6">

          <!--          
          <Manager className="org.apache.catalina.ha.session.BackupManager"
                   expireSessionsOnShutdown="false"
                   notifyListenersOnReplication="true"
                   mapSendOptions="6"/>
          -->
          
          <manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true" />
                
          <channel classname="org.apache.catalina.tribes.group.GroupChannel">
            <membership className="org.apache.catalina.tribes.membership.McastService" address="228.0.0.4" port="45564" frequency="500" dropTime="3000" />
            <receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver" address="auto" port="5000" selectorTimeout="100" maxThreads="6" />

            <sender classname="org.apache.catalina.tribes.transport.ReplicationTransmitter">
              <transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender" />
            </sender>
            <interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector" />
            <interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor" />
            <interceptor className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor" />
          </channel>

          <valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;" />
          <valve className="org.apache.catalina.ha.session.JvmRouteBinderValve" />

          <clusterlistener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener" />
          <clusterlistener className="org.apache.catalina.ha.session.ClusterSessionListener" />
        </cluster>


And in Tomcat's context.xml i have modified the root tag as following

<context distributable="”true”"></context>


Do i need to do anything more?

Regards,
Sandeep
thumbnail
13年前 に Sandeep Nair によって更新されました。

RE: Portlet session attribute null in Cluster

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Hi,

I think i should add replicationMode="synchronous" in Sender for synchronous replication right? And this will guarantee that unless the session is not replicated across all the nodes the thread is not returned.

Regards,
Sandeep
thumbnail
13年前 に Vidya Sagar Padigela によって更新されました。

RE: Portlet session attribute null in Cluster

Junior Member 投稿: 49 参加年月日: 08/05/20 最新の投稿
Sandeep Nair:
Hi,

I think i should add replicationMode="synchronous" in Sender for synchronous replication right? And this will guarantee that unless the session is not replicated across all the nodes the thread is not returned.

Regards,
Sandeep




We also had the same issue and we resolved it by moving and enclosing the Cluster configuration information/elements in between the <Host></Host> element. That solved the issue.

Thanks,
Sagar
thumbnail
10年前 に Amit Doshi によって更新されました。

RE: Portlet session attribute null in Cluster

Liferay Master 投稿: 550 参加年月日: 10/12/29 最新の投稿
Hi Sandeep,

Sorry to digg into old thread.

Same issue I am facing right now on the Liferay 6.1 CE.

Can you please let me know how you solved this?

It's very urgent, we are facing the issue on the production server.

Thanks & Regards,
Amit Doshi