留言板

Session Replication in Cluster Environment

thumbnail
Subhasis Roy,修改在9 年前。

Session Replication in Cluster Environment

Expert 帖子: 275 加入日期: 12-1-20 最近的帖子
Hi,

I have used PortletSession in APPLICATION_SCOPE in liferay, but its not working in cluster environment.

Error in Cluster Environment:
Caused by: java.lang.IllegalArgumentException: JBAS018062: 'employeeBean' attribute with type 'com.test.portlet.command.data.EmployeeBean' cannot be replicated
at org.jboss.as.web.session.ClusteredSession.setAttribute(ClusteredSession.java:824)
at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:130)
at com.liferay.portlet.PortletSessionImpl.setAttribute(PortletSessionImpl.java:200)


"employeeBean" is a POJO object stored in the session and used in all the portlets. As per my understanding this issue is caused because Session is not replicated properly in all the nodes in the cluster.
Please correct my understanding, if wrong.

Is there any draw backs if we configure session replication in cluster environment for Life ray portal.

Thanks,
subhasis
thumbnail
Anil Sunkari,修改在9 年前。

RE: Session Replication in Cluster Environment

Expert 帖子: 427 加入日期: 09-8-12 最近的帖子
Hi Subhasis,

Since its a clustered environment.Please make sure "Sticky Session" enabled in that environment.

Regards,
Anil Sunkari
thumbnail
Andew Jardine,修改在8 年前。

RE: Session Replication in Cluster Environment

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
The whole point of using Session Replication is that the session does not necessarily have to stick to one node in the cluster.
thumbnail
Juan Gonzalez,修改在9 年前。

RE: Session Replication in Cluster Environment

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Hi Subhasis,

all session objects should implement Serializable, please check that.
thumbnail
Subhasis Roy,修改在8 年前。

RE: Session Replication in Cluster Environment

Expert 帖子: 275 加入日期: 12-1-20 最近的帖子
Hi Juan,

All the all the bean objects are serializable and also added <distributable/> tag in the web.xml

but still its giving same issue.
thumbnail
Juan Gonzalez,修改在8 年前。

RE: Session Replication in Cluster Environment

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Check if all attributes of that POJO are implementing Serializable too, all the clues points to that direction.
thumbnail
Subhasis Roy,修改在8 年前。

RE: Session Replication in Cluster Environment

Expert 帖子: 275 加入日期: 12-1-20 最近的帖子
Hi Juan,

It worked. Thanks a lot.

Making the POJO class Serializable and adding the <distributable/> tag in web.xml file worked.

I had cleared the tmp folder of the JBOSS and made a fresh deployment. It's working fine.
thumbnail
Juan Gonzalez,修改在8 年前。

RE: Session Replication in Cluster Environment

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Subhasis Roy:
Hi Juan,

It worked. Thanks a lot.

Making the POJO class Serializable and adding the <distributable/> tag in web.xml file worked.

I had cleared the tmp folder of the JBOSS and made a fresh deployment. It's working fine.


Glad it worked, Thanks.