0

ZK Tomcat Clustering Timeout

asked 2013-01-29 20:31:51 +0800

carpolva gravatar image carpolva
155 4

updated 2013-01-29 20:34:36 +0800

Hi !!

I'm still working on a clustering example, this is my new issue (thanks for the last help) :D

I will omit all the clustering configuration (unless you need this information). Here is a .zul fragment:

<label id="myLabel" value="0"/>
<button id="myButton" label="Generate Value (smart)" forward="onClick=onClickGenerate()">
       <attribute w:name="onClick">
          <![CDATA[
              var value = 'XXX';
              var myLabel = this.$f('myLabel');
              myLabel.setValue(value);
              myLabel.smartUpdate('value', value);
          ]]>
       </attribute>
</button>
<button label="Generate Value (server)" forward="onClick=onClickGenerate2()"/>

Here is a java bean fragment:

public class MyBean extends GenericForwardComposer implements Serializable {
       private Label myLabel;

       public void doAfterCompose(Component comp) {
             try {
                 super.doAfterCompose(comp);
                 myLabel.setAttribute("org.zkoss.zk.ui.updateByClient", true);
             } catch (Exception e) {}
       }

       public void onClickGenerate(ForwardEvent event){
             System.out.println("Label value: " + myLabel.getValue());
       }

       public void onClickGenerate2(ForwardEvent event){
             myLabel.setValue("ZZZ");
       }
}

The zk.xml

<zk>
  <system-config>
    <ui-factory-class>org.zkoss.zk.ui.http.SerializableUiFactory</ui-factory-class>
  </system-config>
  <listener>
    <listener-class>org.zkoss.zkplus.cluster.ClusterSessionPatch</listener-class>
  </listener>
  <device-config>
    <device-type>ajax</device-type>
    <timeout-uri>/timeout.zul</timeout-uri>
  </device-config>
</zk>

As you can see, it only has two ways of updating the label value (through smartUpdate in the client side or invoking the server side).

There're two test cases:

1. Two Tomcat nodes in the same machine.

2. Two Tomcat nodes in different machines.

In the first case there is no problem, in the second case... when I press a button (no matter which one) I'm redirected to the timeout.zul page with its famous message:

"The page or component you request is no longer available. This is normally caused by timeout, opening too many Web pages, or rebooting the server"

I've tried a lot of alternatives reading other different clustering posts, but without success (maybe I'm missing something).

Any help will be appreciated.

Thank you very much :D

delete flag offensive retag edit

5 Answers

Sort by ยป oldest newest most voted
2

answered 2013-01-29 23:07:42 +0800

gekkio gravatar image gekkio flag of Finland
899 1
http://gekkio.fi/blog

That sounds like the clustering is not working at all, so I don't think this is really a ZK problem. Can you look at Tomcat logs and look for clustering-related info? I haven't used native Tomcat clustering in a while, so I might be wrong, but both nodes should report in their log files that they see the other node. Because case 2 doesn't work, it seems that it's some kind of networking configuration problem. Posting the clustering configuration might help in this case.

Here's one more thing you can try: Try running this code on both servers:

System.out.println(java.net.InetAddress.getLocalHost().getHostAddress())

That's the address which will be considered the default "external IP" where the other node will try to connect. If you get strange IPs or 127.0.0.1, that's the reason for your problems. The external IP must be something the other node can connect to, and it can be forced to a fixed value in Tomcat cluster configuration if the automatic value is not correct (set the address attribute in the Receiver element).

link publish delete flag offensive edit

Comments

Hi Gekkio!, thanks for your response. I'll print the host address info and I'll look in more detail the cluster logs, if I have new information I'll let you know. Regards.

carpolva ( 2013-02-14 20:50:40 +0800 )edit
1

answered 2013-01-30 08:19:48 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2013-01-30 08:20:38 +0800

Have you this tag in your web.xml?

web.xml

<distributable/>

link distributable

best Stephan

link publish delete flag offensive edit

Comments

Hi Terry!, thanks for your response. Yes, I have that tag in my web.xml. Regards.

carpolva ( 2013-02-14 20:48:12 +0800 )edit

Same problem occurred with Jboss also.Its work with jsp but whenever we move to zul it occures timeout.(Simple Button click events gives the same result). Your help will appreciated , Thanks !!

natoosandeep ( 2013-08-12 08:06:50 +0800 )edit
0

answered 2013-08-12 08:18:27 +0800

natoosandeep gravatar image natoosandeep
45

Same problem occurred with Jboss also.Its work with jsp but whenever we move to zul it occures timeout.(Simple Button click events gives the same result). Your help will appreciated , Thanks !!

link publish delete flag offensive edit
0

answered 2015-01-15 18:18:32 +0800

ajaidka gravatar image ajaidka
196 4

Did you get any solution for this issue, I am also getting the same.

Thanks AJaidka

link publish delete flag offensive edit
0

answered 2015-01-18 21:36:00 +0800

Darksu gravatar image Darksu
1991 1 4

Hello carpolva,

Please refer to the following url's in order to configure your installation:

http://books.zkoss.org/wiki/ZKInstallationGuide/SettingupServers/Tomcat_Cluster

http://books.zkoss.org/wiki/SmallTalks/2007/April/HowtoRunZKonApache%2BTomcatclustering,Part_I

If you still have issues, then please post your configuration.

Best Regards,

Darksu

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
1 follower

RSS

Stats

Asked: 2013-01-29 20:31:51 +0800

Seen: 67 times

Last updated: Jan 18 '15

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