0

"processing" without results on Apache+Tomcat+ZK

asked 2009-10-05 18:42:29 +0800

barema gravatar image barema
69 1

I have a zk-testapp deployed on a testserver (http://www.360feedback.be/ingrid/).
It's a mock-up application, nothing fancy with the following problem:

Opening one of the pages (by clicking the e.g. the first or second item in the menubar's first menu) works perfect.
After this, if you want to move on to another page (by clicking another item) it stops working ("processing" appears, dissapears, nothing happens).

Strangely, it works perfect when the pages are accessed locally: on localhost navigation from one page to another works perfect.

In Tomcat's stdout.log the following message appears "The event processing thread stops"
Configuration =
Apache 2.2 (redirects the requests to the Tomcat server)
Tomcat 6.0
zk 3.5.2

Does anyone has any idea what this could be about ?
Could it have something to do with Tomcat running behind Apache ?
Does it have something to do with session management ?
Maybe it's just some setting in one of the config files ?

Who can help ?

Thanks,
Bart

delete flag offensive retag edit

10 Replies

Sort by ยป oldest newest

answered 2009-10-05 19:23:51 +0800

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

Can you show us the code which you do call the content page in the middle ?
Have you disabled the event-thread in the your xml-file doc ?

Stephan

link publish delete flag offensive edit

answered 2009-10-05 21:14:01 +0800

barema gravatar image barema
69 1

Well,

I've just disabled the event processing thread: no difference I'm afraid.
Below is the code that calls the center content:

The base page is an "index.zul" with the following structure (I've left out some static content for readability):

<?page id="homePage" contentType="text/html;charset=UTF-8"?>
<zk xmlns:h="http://www.w3.org/1999/xhtml">
<style src="resources/css/default.css"/>
<h:div id="header">
<h:h1><h:a href="#">e-HR tool (analysemodel)</h:a></h:h1>
<h:h2><!-- <include id="searchbar" src="searchbar.zul"/>--> zoek <textbox /></h:h2> <!-- searchBox at right top-->
</h:div>
<h:div id="content">
<h:div id="colOne">
<h:div id="menu">
<include id="menubar" src="menubar.zul"/> <!--this is the menubar on top-->
</h:div>
<h:div style="padding: 0px;">
<hbox>
<include id="navigatieStructuur" src="navigatiestructuur.zul" /><!-- this is the navigation structure on the left-->
<splitter id="s2" collapse="before"/>
<include id="detailScherm" src="introductiescherm.zul" /><!--this is the center content page-->
</hbox>
</h:div>
</h:div>
<h:div id="colTwo">
<!-- right column content goes here -->
</h:div>
<h:div style="clear: both;"> </h:div>
</h:div>
</zk>

the menubar (top) has the following structure:

<?page title="menubar" contentType="text/html;charset=UTF-8"?>
<zk>
<style>
div.z-menubar-hor{
padding: none;
background: none;
border: none;
}
</style>
<zscript>
void showPanel(target){
inc = Path.getComponent("//homePage/detailScherm");
inc.setSrc(null);
inc.setSrc(target+".zul");
}
</zscript>
<menubar id="menubar">
<menu label="onze organisatie" src="/resources/images/orgchart.gif">
<menupopup>
<menuitem src="/resources/images/vcard.png" label="bedrijfsvoorstelling" onClick="showPanel("bedrijfsvoorstelling");" />
<menuitem src="/resources/images/orgchart.gif" label="organigram / who is who" onClick="showPanel("orgchart");" />
<menuitem src="/resources/images/help.png" label="who does what" onClick="showPanel("zoekscherm");" />
<menuitem src="/resources/images/group.png" label="overzicht medewerkers" onClick="showPanel("medewerkersoverzicht");" />
<menuitem label="contactbeheer" onClick="showPanel("rolodex");"/>
<menuitem label="rapporten en modeldocumenten" onClick="alert(self.label)"/>
</menupopup>
</menu>
<!-- followed by more of the same -->
</menubar>
</zk>

the code in the zscript loads another .zul page into the center.
The funny thing is: the first try always work, the second & following always fail.

Left side navigation sits in navigatiestructuur.zul:

<?xml version="1.0" encoding="UTF-8"?>
<zk xmlns:h="http://www.w3.org/1999/xhtml">
<style>
div.z-tree-cell-cnt{
font-size: smaller;
}
</style>
<zscript>
void showPanel(target){
inc = Path.getComponent("//homePage/detailScherm");
inc.setSrc(null);
inc.setSrc(target+".zul");
}
</zscript>
<tree id="tree" width="200px" height="600px">
<treecols sizable="true">
<treecol/>
</treecols>
<treechildren>
<treeitem open="false">
<treerow>
<treecell label="organisatie / wie is wie" />
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="bedrijfsvoorstelling - communicatie" onClick="showPanel("bedrijfsvoorstelling");"/>
</treerow>
</treeitem>
... and so on

Any further suggestions ?

link publish delete flag offensive edit

answered 2009-10-05 21:38:02 +0800

barema gravatar image barema
69 1

Apparently the message "The event processing thread stops" doesn't seem to be created when the problems occur... my mistake!
(unfortunately, the problem is still there)

link publish delete flag offensive edit

answered 2009-10-06 09:44:21 +0800

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

Can this help you?

http://www.zkoss.org/forum/index.zul#path%3DlistComment%3BdiscussionId%3D9639%3BcategoryId%3D14%3B

As many others i prever Executions.createComponents() look here or
here or
here.

best
Stephan

link publish delete flag offensive edit

answered 2009-10-06 12:37:55 +0800

barema gravatar image barema
69 1

I'll certainly try to do it this way, but one thing keeps on bothering me:
when working locally (on localhost & directly on Tomcat, not via Apache), my current approach works like a charm. It's only when using a remote connection (over Apache to Tomcat) that this problem occurs. So, I'm afraid it might have to do with servers & sessions too.

Anyway, I'll try the following:
* try the approach you suggest (Executions.createComponents())
* remove the apache-front (and connect to Tomcat directly) to see if this gives a different result
* try your suggested approach in combination with the direct connection to Tomcat

Thanks for the suggestions so far!
Bart

link publish delete flag offensive edit

answered 2009-10-06 21:08:31 +0800

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

updated 2009-10-06 21:18:15 +0800

Hmmmmmmm, i have running well a test cluster with 3 tomcats behind an apache locally on my notebook.
Seems there is only a little thing not correct configured.
I know there are two smalltalks about clustering. Their you will found sample configuration files like this:


File: ...\Apache2.2\conf\workers.properties

# Define ApacheJkLb, jkstatus which can be used in uriworkermap.properties. 
# The ApacheJkLb is loadbalancing worker

worker.list = ApacheJkLb, jkstatus

       # Set properties for worker1 (ajp13)
        worker.worker1.type=ajp13
        worker.worker1.host=localhost
        worker.worker1.port=8011
        worker.worker1.lbfactor=1
        worker.worker1.connection_pool_timeout=600
        worker.worker1.socket_keepalive=True
        worker.worker1.socket_timeout=60
 
        # Set properties for worker2 (ajp13)
        worker.worker2.type=ajp13
        worker.worker2.host=localhost
        worker.worker2.port=8012
        worker.worker2.lbfactor=1
        worker.worker2.connection_pool_timeout=600
        worker.worker2.socket_keepalive=True
        worker.worker2.socket_timeout=60
 
        # Set properties for worker3 (ajp13)
        worker.worker3.type=ajp13
        worker.worker3.host=localhost
        worker.worker3.port=8013
        worker.worker3.lbfactor=1
        worker.worker3.connection_pool_timeout=600
        worker.worker3.socket_keepalive=True
        worker.worker3.socket_timeout=60
 
 
       # Set "worker.WORKER_NAME.type=lb" will open JK's Load balancering function. In other words, JK becomes a load balancer.
        worker.ApacheJkLb.type=lb
       # Add those workers to the load balancer you  defind before. 
        worker.ApacheJkLb.balance_workers=worker1,worker2,worker3
       #  Set "worker.WORKER_NAME.type=status" to open a channel to Admin JK Connector.
        worker.jkstatus.type=status


File: C:\tomcat6_cluster_local\tomcat_worker1\conf\server.xml

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">

	<!--
		Global JNDI resources Documentation at /docs/jndi-resources-howto.html
	-->
	<GlobalNamingResources>
		<!--
			Editable user database that can also be used by UserDatabaseRealm to
			authenticate users
		-->
		<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
		<Resource auth="Container" driverClassName="org.postgresql.Driver" logAbandoned="true" maxActive="50" maxIdle="10" maxOpenPreparedStatements="50" maxWait="10000" name="jdbc/toledo" password="toledo" poolPreparedStatements="true" removeAbandoned="true" removeAbandonedTimeout="180" scope="Shareable" testWhileIdle="true" timeBetweenEvictionRunsMillis="600000" type="javax.sql.DataSource" url="jdbc:postgresql://localhost:5432/test_db" username="toledo" validationQuery="Select usr_id from sec_user limit 1"/>

		<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
	</GlobalNamingResources>

	<Service name="Catalina">

		<!-- Define a non-SSL HTTP/1.1 Connector on port 8081 -->
		<Connector acceptCount="100" connectionTimeout="30000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8081" redirectPort="8444"/>

		<!-- Define an AJP 1.3 Connector on port 8011 -->
		<Connector enableLookups="false" port="8011" protocol="AJP/1.3" redirectPort="8444"/>


		<!-- You should set jvmRoute to support load-balancing via AJP ie : -->
		<Engine defaultHost="localhost" jvmRoute="worker2" name="Catalina">

			<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">


				<Cluster channelSendOptions="8" className="org.apache.catalina.ha.tcp.SimpleTcpCluster">
					<Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/>

					<Channel className="org.apache.catalina.tribes.group.GroupChannel">

						<Membership className="org.apache.catalina.tribes.membership.McastService" mcastAddr="228.0.0.4" mcastDropTime="3000" mcastFrequency="500" mcastPort="45564"/>

						<Receiver address="auto" autoBind="100" className="org.apache.catalina.tribes.transport.nio.NioReceiver" maxThreads="6" port="4001" selectorTimeout="5000"/>

						<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
							<Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
						</Sender>

						<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
						<Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
					</Channel>

					<Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/>
					<Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

					<Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer" deployDir="/temp/war-deploy/" tempDir="/temp/war-temp/" watchDir="/temp/war-listen/" watchEnabled="false"/>

					<ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
					<ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

				</Cluster>


               </Host>

			<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>


		</Engine>
	</Service>
</Server>

best
Stephan

link publish delete flag offensive edit

answered 2009-10-12 12:19:24 +0800

barema gravatar image barema
69 1

I've tested the following:
* removing Apache Server (all requests are handled immediately by Tomcat ==> no effect
* modify code to use .invalidate() ==> no effect
* modify code to use Executions.createComponents() ==> no effect

All of these changes give no result: when I use the menubar to load a page into an include it works for the first request, all following requests give the same result: first the message "processing" appears, which disappears after 5 seconds or so ... and that's it.

I've turned on logging which gives the following interesting result

Oct 12, 2009 2:09:48 PM org.zkoss.zk.ui.http.WebManager getDesktop:314
FINE: Create desktop for /index.zul
Oct 12, 2009 2:09:48 PM org.zkoss.web.util.resource.ResourceLoader load:92
FINE: Loading C:\Tomcat 6.0\webapps\ingrid\index.zul
Oct 12, 2009 2:09:48 PM org.zkoss.xel.taglib.Taglibs getDefaultTLDs:292
FINE: Loading jar:file:/C:/Tomcat%206.0/webapps/ingrid/WEB-INF/lib/zk.jar!/metainfo/tld/config.xml
Oct 12, 2009 2:09:48 PM org.zkoss.xel.taglib.Taglibs getDefaultTLDs:292
FINE: Loading jar:file:/C:/Tomcat%206.0/webapps/ingrid/WEB-INF/lib/zul.jar!/metainfo/tld/config.xml
Oct 12, 2009 2:09:48 PM org.zkoss.xel.taglib.Taglibs getDefaultTLDs:292
FINE: Loading jar:file:/C:/Tomcat%206.0/webapps/ingrid/WEB-INF/lib/zweb.jar!/metainfo/tld/config.xml
Oct 12, 2009 2:09:48 PM org.zkoss.web.util.resource.ResourceLoader load:92
FINE: Loading C:\Tomcat 6.0\webapps\ingrid\menubar.zul
Oct 12, 2009 2:09:49 PM org.zkoss.web.util.resource.ResourceLoader load:92
FINE: Loading C:\Tomcat 6.0\webapps\ingrid\navigatiestructuur.zul
Oct 12, 2009 2:09:49 PM org.zkoss.web.util.resource.ResourceLoader load:92
FINE: Loading C:\Tomcat 6.0\webapps\ingrid\introductiescherm.zul
Oct 12, 2009 2:09:49 PM org.zkoss.util.resource.Locators myLocate:128
FINE: svl=/js/zk/html/lang/mesg.js base=/js/zk/html/lang/mesg ext=.js
Oct 12, 2009 2:09:49 PM org.zkoss.util.resource.Locators myLocate:128
FINE: svl=/js/zul/lang/msgzul.js base=/js/zul/lang/msgzul ext=.js
Oct 12, 2009 2:09:54 PM org.zkoss.web.util.resource.ResourceLoader load:92
FINE: Loading C:\Tomcat 6.0\webapps\ingrid\bedrijfsvoorstelling.zul
Oct 12, 2009 2:10:00 PM org.zkoss.zk.ui.impl.UiEngineImpl isReqDup0:876
FINE: Repeat request
sid: 1
user-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.25 Safari/532.0
content-length: 39
content-type: application/x-www-form-urlencoded;charset=UTF-8
ip: 81.82.211.49

What I did was the following:
1. load the basic page at http://www.360feedback.be/ingrid/
2. click on the menubar "onze organisatie" and select "bedrijfsvoorstelling" (the appropriate information appears)
3. click on the menuItem below ("onze organisatie" => "organigram") => "processing" appears ... but no result

The message in the logging "Repeat Request" appears once per click on another menuitem after a first succesful attempt.

Any ideas and/or suggestions ?

link publish delete flag offensive edit

answered 2009-10-12 18:18:05 +0800

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

barema, if you debug your code. Have you ever look if the center area is clear before added the new content to it.
Like: center.getChildren().clear().

	private void showPage(String zulFilePathName) throws InterruptedException {
		try {
			/* get an instance of the borderlayout defined in the zul-file */
			Borderlayout bl = (Borderlayout) Path.getComponent("/outerIndexWindow/borderlayoutMain");
			/* get an instance of the searched CENTER layout area */
			Center center = bl.getCenter();
			center.setFlex(true);
			/* clear the center child comps */
			center.getChildren().clear();
			/*
			 * create the page and put it in the center layout area
			 */
			Executions.createComponents(zulFilePathName, center, null);

			if (logger.isDebugEnabled()) {
				logger.debug("--> calling zul-file: " + zulFilePathName);
			}
		} catch (Exception e) {
			Messagebox.show(e.toString());
		}
	}

best
Stephan

link publish delete flag offensive edit

answered 2009-10-16 20:24:33 +0800

barema gravatar image barema
69 1

Stephan,

Thanks for your suggestions, but they don't help so far.
The point is that the request is not handled, since it is considered a duplicate request
"REPEAT REQUEST" is generated by org.zkoss.zk.ui.impl.UiEngineImpl (see code below).
If I understand it, this is because the request-id is recognized as one that has been used earlier.

The funny thing is, this doesn't happen when working on localhost, only when the page is called from another computer.

Any suggestions / similar experiences ?
Bart

Code snippet from
http://www.docjar.com/html/api/org/zkoss/zk/ui/impl/UiEngineImpl.java.html

701 public Collection execUpdate(Execution exec, List requests,
702 String pfReqId, AuWriter out) throws IOException {
703 if (requests == null)
704 throw new IllegalArgumentException();
705 assert D.OFF || ExecutionsCtrl.getCurrentCtrl() == null:
706 "Impossible to re-activate for update: old="+ExecutionsCtrl.getCurrentCtrl()+", new="+exec;
707
708 final UiVisualizer uv = doActivate(exec, true, false);
709 final Desktop desktop = exec.getDesktop();
710 final DesktopCtrl desktopCtrl = (DesktopCtrl)desktop;
711 final String sid = ((ExecutionCtrl)exec).getRequestId();
712 if (sid != null) {
713 final Collection resps = desktopCtrl.getLastResponse(sid);
714 if (resps != null) {
715 if (log.debugable()) {
716 final Object req = exec.getNativeRequest();
717 log.debug("Repeat request\n"+
718 (req instanceof ServletRequest ? Servlets.getDetail((ServletRequest)req):"sid: "+sid));
719 }
720 out.write(resps);
721 doDeactivate(exec); //deactive
722 return null; //done
723 }
724 }
725

link publish delete flag offensive edit

answered 2009-10-17 14:24:41 +0800

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

barema, please post the thread newly under the 'Help' category. Most guys do not look on the this 'Install' category.

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: 2009-10-05 18:42:29 +0800

Seen: 2,232 times

Last updated: Oct 17 '09

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