-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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.
@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?
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.
Asked: 2019-07-09 15:20:50 +0800
Seen: 13 times
Last updated: Jul 26 '19
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 )editwhat's not there? the latest version or which class?
cor3000 ( 2019-07-17 11:12:34 +0800 )edit