-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi guys
I need help running ZK on cloudbees.net (tomcat6) in a cloud. Got the following error: exception java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute javax.zkoss.zk.ui.Session org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1351) org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1312) org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:130) org.zkoss.zk.ui.http.SessionAgent.put(SessionAgent.java:30) org.zkoss.zk.ui.http.SimpleSessionCache.put(SimpleSessionCache.java:36) org.zkoss.zk.ui.sys.SessionsCtrl.newSession(SessionsCtrl.java:158) org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:435) org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:416) org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:126) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Is ZK cloud compliant ? Regards IanF
Very simpel, I'll explain with code.
public class SendObject implements Serializable {
private SubObject object;
// getters and setters for this object
}
public class SubObject {
private String text;
// also getters and setters
}
Now with this you have the same error as you. You have to implements Serializable also on the SubObject. Then it should normally works.
Greetz chill.
Thanks for the reply, but unfortunately it did not solve anything.
Ive only have mvc controlers and then pojo's and made every class now Serializable and gave them a serialVersionID.
However the error states the zk session is not serializable.
Non-serializable attribute javax.zkoss.zk.ui.Session
Frankly I am new to ZK (love it to bits) and just did not had time to drill into the src.
I suspect it need to be serializable to move on the cloud's nodes, or something.
Alt. do I have to implement my own sessions, I am not really using session at all, beside sticking some pojo's into the server session attributes between redirects. And the pojos are now serializable.
Asked: 2014-01-29 13:27:39 +0800
Seen: 10 times
Last updated: Jan 29 '14