0

ZK-5.0.7.1 Timing Out on Google App Engine (GAE)

asked 2011-08-28 02:38:11 +0800

rhanna gravatar image rhanna
3

I have a very simple ZK application with a single window, a single button with an onClick event listener that performs a MessageBox.

The application works fine in my local google app engine environment, but not when deployed to app engine servers.

The issue is that, when the button is clicked, instead of getting the MessageBox pop-up, the session always times out with the 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."

There is absolutely nothing fancy about this application.

I've followed the Installation Guide for ZK on Google App Engine.

Does anyone have any ideas on how to resolve this?

Thanks.

delete flag offensive retag edit

9 Replies

Sort by ยป oldest newest

answered 2011-08-28 20:31:05 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Please post your code that caused the issue (zul, web.xml, zk.xml) and steps you proceed. It will be easier for the community to help you locate the issue. Thanks.

link publish delete flag offensive edit

answered 2011-09-22 09:11:23 +0800

antiso gravatar image antiso
18

Same in ZK 5.0.8. Both buttons doesn't work neither with composer listener nor ZUL inline.

index.zul

<window border="none" id="main" width="100%" height="100%" apply="zktest.hellomvc.HelloZKComposer">
	<vlayout ><button id="sayHelloBtn" label="Say Hello"/>
	<button  id="sayXZ" label="Say XZ">
		<attribute name="onClick">
			Messagebox.show("XZ");
		</attribute>
	</button>
	</vlayout>
</window>

zk.xml
<zk>
    <!-- clustering environment -->
    <system-config>
        <disable-event-thread/>
        <ui-factory-class>org.zkoss.zk.ui.http.SerializableUiFactory</ui-factory-class>
    </system-config>
    <!-- clustering environment, since ZK 5.0.8-->
    <listener>
        <listener-class>org.zkoss.zkplus.cluster.ClusterSessionPatch</listener-class>
    </listener>
 
    <!-- GAE doesn't allow user's thread -->
    <client-config>
        <resend-delay>-1</resend-delay>
    </client-config>
</zk>

web.xml

<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
    <listener>
        <description>ZK listener for session cleanup</description>
        <listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
    </listener>
 
    <servlet>
        <servlet-name>zkLoader</servlet-name>
        <servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
        <init-param>
            <param-name>update-uri</param-name>
            <param-value>/zkau</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>auEngine</servlet-name>
        <servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>zkLoader</servlet-name>
        <url-pattern>*.zul</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>auEngine</servlet-name>
        <url-pattern>/zkau/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>auEngine</servlet-name>
        <url-pattern>/zkau</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.zul</welcome-file>
        <welcome-file>index.zhtml</welcome-file>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>

appengine-web.xml


<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
	<application>tags42</application>
	<version>5</version>
	<sessions-enabled>true</sessions-enabled>

	<static-files>
		<exclude path="/**.zul" />
		<exclude path="/**.zhtml" />
	</static-files>
	<resource-files>
		<include path="/**.zul" />
		<include path="/**.zhtml" />
	</resource-files>
</appengine-web-app>

link publish delete flag offensive edit

answered 2011-09-22 12:38:10 +0800

antiso gravatar image antiso
18

updated 2011-09-22 14:00:18 +0800

Solution found. This error occurs because of changes in org.zkoss.io.Serializables.smartWrite(). There was added code that uses java.util.logging.LogManager that is restricted API for GAE.

To avoid this use ZK version 5.0.5.

Sample code is on Bitbucket. Working example is here for a while tags42

link publish delete flag offensive edit

answered 2011-09-22 21:43:08 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

updated 2011-09-22 21:43:24 +0800

Hi Vladimir, thanks for the information. I posted it to the bug tracker. Please follow Bug ZK-450.

link publish delete flag offensive edit

answered 2011-09-22 22:24:17 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

Hi Vladimir, did you try the following setting mentioned in GAE developer's guide?

# In your .gwt.xml file
<inherits name="com.google.gwt.logging.Logging"/>

link publish delete flag offensive edit

answered 2011-09-23 03:35:05 +0800

antiso gravatar image antiso
18

Hi Tom, I haven't try this since there is no any .gwt.xml while using ZK. Despite this, I don't think it will help. It's just for unification of logging mechanism with GWT and user code. The LogManager is restricted API anyway.

link publish delete flag offensive edit

answered 2011-09-27 01:43:29 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi Antiso,

You can download the latest ZK 5.0.9-FL version later, and specify the setting into the zk.xml to solve this issue.

link publish delete flag offensive edit

answered 2011-11-07 11:46:43 +0800

antiso gravatar image antiso
18

Hello, Jumper,

I've checked ZK 5.0.9 with recommended settings and there are some other problem. For example alert window doesn't hide on "Ok" click, borderlayout sample don't work ...
So, seems like 5.0.6 is a best choice.

There is some exception. I don't know real cause:

Nested in javax.servlet.ServletException: java.lang.NullPointerException:
java.lang.NullPointerException
	at org.zkoss.zk.ui.impl.PageImpl.getInterpreter(PageImpl.java:895)
	at org.zkoss.zk.ui.impl.PageImpl.readObject(PageImpl.java:1203)
	at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
....

link publish delete flag offensive edit

answered 2011-12-05 08:09:44 +0800

matthewgo gravatar image matthewgo
375

Hi antiso,
Please try to use composer to define the event instead of using zscript in 5.0.9 .

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: 2011-08-28 02:38:11 +0800

Seen: 700 times

Last updated: Dec 05 '11

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