-
Bug
-
Resolution: Won't Fix
-
Normal
-
None
-
6.5.4
-
Security Level: Jimmy
-
None
-
Glassfish 3/4
as a fix for the clustering issue ZK-1896 (for Jboss AS 7) the <distributable/> tag was added to the web-fragment.xml in the zk.jar
This change causes an Exception when a zk session is created on first request
java.lang.IllegalArgumentException: PWC2788: setAttribute: Non-serializable attribute with name javax.zkoss.zk.ui.Session
at org.apache.catalina.session.ManagerBase.checkSessionAttribute(ManagerBase.java:832)
at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1713)
at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:178)
at org.zkoss.zk.ui.http.SessionAgent.put(SessionAgent.java:30)
at org.zkoss.zk.ui.http.SimpleSessionCache.put(SimpleSessionCache.java:36)
at org.zkoss.zk.ui.sys.SessionsCtrl.newSession(SessionsCtrl.java:158)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:435)
at org.zkoss.zk.ui.http.WebManager.getSession(WebManager.java:416)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Glassfish seems to assume the whole application as distributable and doesn't allow the non-serializable SimpleSession to be added to the the HttpSession, even if no clustering is required.
(Not sure) This might be a bug in Glassfish, as the merging rules for web.xml/web-fragment.xml seem complex (and confusing) and might be interpreted differently by containers.
see
- http://download.oracle.com/otn-pub/jcp/servlet-3.0-fr-eval-oth-JSpec/servlet-3_0-final-spec.pdf Chapter 8.2.3 5.g.ii/viii - Page 74
- https://issues.jboss.org/browse/SEAMFACES-173 (related bug, taking the same approach as zk.jar)
The current workaround is to use the SerializableUiFactory when deploying ZK 6.5.4/7.0.0 on a Glassfish Container
add the following configuration element to the zk.xml
<system-config> <ui-factory-class>org.zkoss.zk.ui.http.SerializableUiFactory</ui-factory-class> </system-config>
- relates to
-
ZK-1896 ZK session timeout on JBoss AS 7 cluster issue
- Closed