Saturday, January 26, 2008

ZK: Non-serializable attribute error on StandardSession

I got this one while starting up Tomcat and struggled with it for probably two days. The stack trace looks something like this:

SEVERE: Servlet.service() for servlet zkLoader threw exception
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1293)
at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1254)
at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:130)
at org.zkoss.zk.ui.http.WebManager.newSession(WebManager.java:308)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:320)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:287)


The problem was a tag in my web.xml. I must have clicked it on in IDEA's graphical view of the web.xml. Just remove the tag and you're good to go.