Fórumok

Portlet session attribute null in Cluster

thumbnail
Sandeep Nair, módosítva 13 év-val korábban

Portlet session attribute null in Cluster

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
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
Sandeep Nair, módosítva 13 év-val korábban

RE: Portlet session attribute null in Cluster

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
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
Sandeep Nair, módosítva 13 év-val korábban

RE: Portlet session attribute null in Cluster

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
Has anyone faced this problem. Its happening in Lifeary 6 EE
thumbnail
Minhchau Dang, módosítva 13 év-val korábban

RE: Portlet session attribute null in Cluster

Liferay Master Bejegyzések: 598 Csatlakozás dátuma: 2007.10.22. Legújabb bejegyzések
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
Sandeep Nair, módosítva 13 év-val korábban

RE: Portlet session attribute null in Cluster

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
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
Sandeep Nair, módosítva 13 év-val korábban

RE: Portlet session attribute null in Cluster

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
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
Vidya Sagar Padigela, módosítva 13 év-val korábban

RE: Portlet session attribute null in Cluster

Junior Member Bejegyzések: 49 Csatlakozás dátuma: 2008.05.20. Legújabb bejegyzések
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
Amit Doshi, módosítva 10 év-val korábban

RE: Portlet session attribute null in Cluster

Liferay Master Bejegyzések: 550 Csatlakozás dátuma: 2010.12.29. Legújabb bejegyzések
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