-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I installed the fresh nightly build of zk-5.0 (zk-bin-5.0.0-RC2-2009-12-03) on GAE and I keep getting the No SessionHandler error. Here is the stack trace from the GAE log:
/pages/patientvisit.zul
java.lang.IllegalStateException: No SessionHandler or SessionManager
at org.mortbay.jetty.Request.getSession(Request.java:987)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:341)
at org.zkoss.zk.ui.http.SessionResolverImpl.getSession(SessionResolverImpl.java:37)
at org.zkoss.zk.ui.Sessions.getCurrent(Sessions.java:56)
at org.zkoss.zk.ui.Sessions.getCurrent(Sessions.java:44)
at org.zkoss.zk.ui.http.SimpleSession.sessionDidActivate(SimpleSession.java:505)
at org.zkoss.zk.ui.http.SimpleSession.recover(SimpleSession.java:402)
at org.zkoss.zk.ui.sys.SessionsCtrl.getSession(SessionsCtrl.java:113)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:347)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:329)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:141)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
I have kept the proper settings in zk.xml.
<system-config>
<disable-event-thread />
<ui-factory-class>org.zkoss.zk.ui.http.SerializableUiFactory</ui-factory-class>
</system-config>
<client-config>
<resend-delay>-1</resend-delay>
</client-config>
Just after couple of pages serving I am getting the session handler error. Is it a known problem or am I missing something?
Please help in fixing this as I am completely stuck with this issue.
-kesav
I have errors compiling zk sources. Can you send me zk.jar with this changes to [email protected]?
Thanks
protected void sessionDidActivate(HttpSession hsess) {
//Note: in Tomcat, servlet is activated later, so we have to
//add listener to WebManager instead of process now
//final Session old = SessionsCtrl.getCurrent(); //shall be null; just in case
SessionsCtrl.setCurrent(this);
try {
_navsess = hsess;
WebManager.addActivationListener(
hsess.getServletContext(),
//FUTURE: getServletContext only in Servlet 2.3 or later
new WebManagerActivationListener() {
public void didActivate(WebManager webman) {
_wapp = webman.getWebApp();
((WebAppCtrl)_wapp)
.sessionDidActivate(SimpleSession.this);
}
});
for (Enumeration en = getAttrNames(); en.hasMoreElements();) {
final String nm = (String)en.nextElement();
didActivate(getAttribute(nm));
}
} finally {
//SessionsCtrl.setCurrent(old);
SessionsCtrl.setCurrent((Session)null);
}
}
The highlighted ones are the changes.
Please can you post the class-code here?
thx
Stephan
I finally figured out what is the issue with GAE and zk. I have to patchup the zk code to fix this. It's because of the GAE's load balancing and zk's session caching. When we run on local machine there is no load balancer so everything was fine. When we upload the app to GAE there is load balancers come in picture and zk is failing. I have to fix the org.zkoss.zk.ui.http.SimpleSession class to not look for old session during recover process. After this fix every thing works great in GAE. If any one wants the patch let me know I am happy to provide the patch.
If ZK folks can incorporate this fix in their future builds that would be really great.
I added the <distributable /> but still failing. I don't think it's because of timeout as it happens in just second or third request itself.
The stack trace shows 2 filters one is our application specific where we check for login credentials and second one Spring OpenPersistenceManagerInViewFilter.
/pages/usermgmt/customersearch.zul
java.lang.IllegalStateException: No SessionHandler or SessionManager
at org.mortbay.jetty.Request.getSession(Request.java:987)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:341)
at org.zkoss.zk.ui.http.SessionResolverImpl.getSession(SessionResolverImpl.java:37)
at org.zkoss.zk.ui.Sessions.getCurrent(Sessions.java:56)
at org.zkoss.zk.ui.Sessions.getCurrent(Sessions.java:44)
at org.zkoss.zk.ui.http.SimpleSession.sessionDidActivate(SimpleSession.java:505)
at org.zkoss.zk.ui.http.SimpleSession.recover(SimpleSession.java:402)
at org.zkoss.zk.ui.sys.SessionsCtrl.getSession(SessionsCtrl.java:113)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:347)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:329)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:143)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter.doFilterInternal(OpenPersistenceManagerInViewFilter.java:105)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at com.bodyfs.framework.filters.ApplicationFilter.doFilter(ApplicationFilter.java:53)
Please any other insight? In which scenario's zk throws this kind of no session error?
Only a hint:
web.xml
<!-- /// 'distributable' /// --> <!-- /// Makes the application /// --> <!-- /// suitable for running in an distributed /// --> <!-- /// environment like a tomcat cluster. /// --> <distributable />
What other frameworks do you use?
Comes this error if an other user is logged in?
Where is your session-timeout is configured?
This bug is really killing all my decision of using ZK. Now I am almost close to delivery of the project and can't figure out why this Session thing failing when deployed to GAE. Please please some one help me to fix this out. It would take me more time to rework my application to drop ZK
I followed the exact steps that were given in the doc. I can get some pages and after a while the session error kicks in. The session error is so random some times it occurs on the second page some times it occur in after couple of page navigations. I am not sure how can I post code. When I run locally from my eclipse environment everything works fine.
I guess there is something wrong with the session handling code when uploaded to GAE.
Hi,kesavkolla
I try this demo
and replace lib to zk-bin-5.0.0-RC2-2009-12-03
it works well
Could you post your sample code ?
Asked: 2009-12-06 01:57:12 +0800
Seen: 1,225 times
Last updated: Dec 28 '09