0

Not able to maintain session in Standalone wildfly cluster

asked 2019-07-09 15:20:50 +0800

ankutalwar gravatar image ankutalwar
1

We are trying to setup standalone cluster on wildfly 13 and cluster is working perfectly fine except one feature which is displaying the excel in our web application. We are using Zk framework to show excel. The problem which we are facing is that the excel is perfectly fine when we are working on a single machine but as soon as we introduce another server in the cluster. We get session Time out on Zk. The current pom.xml , zk.xml and jboss-web.xml and web.xml I am attaching and the issue which I am facing is also I am attaching. Please provide any useful feedback for the problem.

    <commons-io>2.4</commons-io>
            ....
        <id>ZK CE</id>
        <name>ZK CE Repository</name>
        <url>MVN Repo zkoss</url>
    </repository>
    <repository>
        <id>ZK EVAL</id>
        <name>ZK Evaluation Repository</name>
        <url>Eval repo zkoss </url>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>zkmaven</id>
        <name>ZK Maven Plugin Repository</name>
        <url>MVN repo</url>
    </pluginRepository>
</pluginRepositories>
<dependencies>
    <dependency>
        <groupId>org.zkoss.zss</groupId>
        <artifactId>zss</artifactId>
        <version>3.5.0</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zkbind</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zul</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zkplus</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zhtml</artifactId>
        <version>${zk.version}</version>
    </dependency>

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io}</version>
    </dependency>
</dependencies>

zk.xml

   <system-config>
         <ui-factory-class>org.zkoss.zk.ui.http.SerializableUiFactory</ui-factory-class>
    <disable-zscript>true</disable-zscript>
</system-config>

jboss-web.xml

<jboss-web> <context-root>speadsheet</context-root> <replication-config> <replication-granularity>SESSION</replication-granularity> </replication-config> <max-active-sessions>5</max-active-sessions> </jboss-web>

web.xml contains tag

When I run this on standalone cluster I get not serializable exception on org.infinispan.commons.marshall.NotSerializableException: org.zkoss.zss.ui.impl.ua.ApplyBorderHandler

delete flag offensive retag edit

Comments

Thanks cor3000 for pointing out the version difference. Now I am using version 3.8.1. Now the Exception which I am getting is with a different class org.infinispan.commons.marshall.NotSerializableException: org.zkoss.zss.ui.impl.SimpleCellDisplayLoader. I checked the latest version it is not there.

ankutalwar ( 2019-07-10 17:14:11 +0800 )edit

what's not there? the latest version or which class?

cor3000 ( 2019-07-17 11:12:34 +0800 )edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2019-07-10 10:28:39 +0800

cor3000 gravatar image cor3000
6280 2 7

You already found the answer to your problem in your last sentence ;) The error message clearly indicates that an object of class ApplyBorderHandler is not serializable. That's a definite reason for session replication to fail, which relies on object serialization.

I assume you are using an old version of ZK spreadsheet (you simply forgot to mention): The class in question did not implement the Serializable interface in version 3.8.0. https://www.zkoss.org/javadoc/zss/3.8.0/org/zkoss/zss/ui/impl/ua/ApplyBorderHandler.html

However since 3.8.1 the Serializable interface was added. https://www.zkoss.org/javadoc/zss/3.8.1/org/zkoss/zss/ui/impl/ua/ApplyBorderHandler.html

Anyway the latest version is 3.9.4 which is obviously the first choice, when upgrading.

link publish delete flag offensive edit
0

answered 2019-07-25 13:45:31 +0800

ankutalwar gravatar image ankutalwar
1

@cor3000 I am able to resolve the session replication issue using the version which you suggested. Now I am able to maintain the session on both the servers. Now the problem which I am facing is that If my excel has multiple sheets. I am not able to switch between sheets It is staying on the 1st sheet. Can you help me with any approcah?

link publish delete flag offensive edit
0

answered 2019-07-26 11:35:23 +0800

cor3000 gravatar image cor3000
6280 2 7

When using clustering with ZK it's only working (correctly and efficiently) when using sticky sessions ... so please make sure this setting is enabled.

Switching between nodes should only happen if one node is unavailable (shut down, crashed, disconnected from the cluster) - the session should then failover to another node, and stay there until this node goes down.

If node switching happens arbitrarily (or round robin) between frequent requests, race conditions WILL occur, for which ZK has no chance to synchronize updates to the component state - such as switching a sheet. ZSS will send quite a lot of smaller requests which need to be processed in order, which can only be achieved if they arrive at the same node.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
3 followers

RSS

Stats

Asked: 2019-07-09 15:20:50 +0800

Seen: 13 times

Last updated: Jul 26 '19

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More