0

Server push

asked 2008-09-24 22:15:57 +0800

Col gravatar image Col
135 1 6

I'm new to ZK and testing it's suitability for an upcoming project. One of the *must have* features is server push. I am currently attempting to run the Stock Chart example (http://www.zkoss.org/smalltalks/stockchart/) in an attempt to give me a basis from which to build and expand my knowledge of ZK. However, I can't get it going. The empty chart appears but no information is shown. In the log file is this error:

INFO: active StockChartUpdate : Thread-17
Exception in thread "Thread-16" org.zkoss.zk.ui.DesktopUnavailableException: Stopped
at org.zkoss.zkmax.ui.impl.CometServerPush.activate(CometServerPush.java:257)
at org.zkoss.zk.ui.Executions.activate(Executions.java:536)
at org.zkoss.zk.ui.Executions.activate(Executions.java:507)
at StockChartUpdate.run(StockChartUpdate.java:69)

My Java scripts and zul file are unchanged from the downloaded source code of that example. With my lack of understanding of how ZK works 'under the hood' I'm finding it difficult to understand why this error appears and how to fix it. If anybody could point me in the right direction I would greatly appreciate it.

The problem may be related to the software version I am running compared to the version the Stock Chart example was originally designed on.
Tomcat 6.0.18
ZK enterprise 3.5.0
Mandriva 2008

- Col

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2008-09-25 00:51:52 +0800

robertlee gravatar image robertlee
561

Hi Col,

I tried it on my FF2, IE6, Opera, Safari and Chrome with tomcat 6.0.18, I had no trouble running it,
can you list the steps for replication so I can help you? Would be good to know which java environment you are running too.

Thanks.

link publish delete flag offensive edit

answered 2008-09-25 01:07:29 +0800

Col gravatar image Col
135 1 6

Hi Rob,

My jdk is 1.6.0_07.

I installed stock_chart.war file using the tomcat manager and then when things weren't working I recompiled the java files and replaced the existing class files.

Also I was hoping to use the Server Push Class so added the following to WEB-INF/zk.xml (as per the instructions) but, as the original post shows, it doesn't seem to make any difference as CometServerPush seems to be used.

<device-config>
<device-type>ajax</device-type>
<server-push-class>org.zkoss.zkex.ui.impl.PollingServerPush</server-push-class>
</device-config>

As for the zk installation the instructions say to copy jar files to $TOMCAT_HOME/shared/lib. Since there is no shared directory with tomcat 6.0.18 I created a shared directory and symlinked shared/lib back to $TOMCAT_HOME/lib. Not sure if this is relevant.

Thanks,
- Col

link publish delete flag offensive edit

answered 2008-09-25 02:06:49 +0800

robertlee gravatar image robertlee
561

updated 2008-09-25 02:07:55 +0800

Col,

I am pretty sure you will not need to add any zk jars to tomcat's library (as they were already provided by the stock_chart.war).

What I did was the following (perhaps you can try from a fresh start):

with no zk library under my tomcat nor java environment,

1.downloaded the stock_chart.war, drop it under \apache-tomcat-6.0.18\webapps
2.start tomcat
3.open in my firefox2 browser: http://localhost:PORT#HERE/stock_chart/serverpush.zul

with no configurations.

Cheers,

link publish delete flag offensive edit

answered 2008-09-25 06:56:44 +0800

Col gravatar image Col
135 1 6

Finally got it working.

As Rob suggested I reinstalled tomcat from scratch and installed stock_chart.war via the manager. This still caused problems. After much reading logs, head scratching and trial and error I essentially deleted all the jar files from $TOMCAT_HOME/webapps/stock_chart/WEB-INF/lib/ and replaced them with zk-bin-3.5.0/dist/lib/*.jar and zk-bin-3.5.0/dist/lib/zkforge/*.jar and zk-bin-3.5.0/dist/lib/ext/*.jar.

Thanks for your help Rob.
- Col

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2008-09-24 22:15:57 +0800

Seen: 403 times

Last updated: Sep 25 '08

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