Remebering tree state in a conversation
adamw Oct 20, 2007 4:02 PMHello,
I want to hold the tree state in a conversation (using a conversation scoped Seam bean), so following http://www.jboss.com/index.html?module=bb&op=viewtopic&t=119410 I added to <rich:tree ...> an attribute "componentState" with a value binding.
And it works very well, except for the case when a session timeout occurs (I left my computer for an hour with a running AS and when I came back I saw this exception):
17:20:44,677 WARN [Component] Exception calling stateful session bean default @Remove method: pageTree java.lang.RuntimeException: java.lang.RuntimeException: org.jboss.serial.exception.SerializationException: Could not create instance of org.richfaces.component.state.TreeState - org.richfaces.component.state.TreeState at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postActivate(LifecycleInterceptorHandler.java:152) at org.jboss.ejb3.stateful.StatefulContainer.invokePostActivate(StatefulContainer.java:400) at org.jboss.ejb3.stateful.StatefulBeanContext.postActivate(StatefulBeanContext.java:381) at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:316) (...) Caused by: org.jboss.serial.exception.SerializationException: Could not create instance of org.richfaces.component.state.TreeState - org.richfaces.component.state.TreeState at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:342) at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:239) at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) at (...) Caused by: java.lang.InstantiationException: org.richfaces.component.state.TreeState at java.lang.Class.newInstance0(Class.java:335) at java.lang.Class.newInstance(Class.java:303) at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:334) ... 78 more
As I suspect the bean was serialized and then it can't be de-serialized as there is no no-args constructor.
Any help appreciated :)
Thanks,
Adam