Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-546

when HTTP session is deserialized, it failed to create session-scoped bean in composer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.10
    • 5.0.8, 5.0.9
    • Clustering
    • None
    • Tomcat 7

      Users has encounterd a exception when starting Tomcat after upgrading from zk EE 5.0.7 to 5.0.8.
      When restarting Tomcat, an exception happens during session deserialization. The exception said Spring failed creating session-scoped bean, because http request doesn't exist.
      (The full stacktrace is in "catalina 2011-10-26.log", line 644)

      User provided reproducing step:

      To reproduce this scenario, I start up Tomcat (with a clean install, work directory is deleted, etc.), I then hit the local site from a browser. It forces me to log in, then from a second screen select an "environment" (test vs. production for example) after which I reach the main page. From there I just click on one of our menu items which loads a tab panel into the main screen's tabbox. Once I've done that, I do a graceful shutdown of Tomcat - you can see this start in the catalina log about line 360. I then restart Tomcat. At line 644 in the catalina log is where the specific issue I'm trying to solve starts. homeMainPanelController is a prototype scoped bean that extends GenericForwardComposer. userWorkspace is a session scoped bean that is defined as a field of homeMainPanelController with the @Inject annotation.

      We have been using this same structure for many months now without any issues starting/restarting Tomcat but started receiving these exceptions when attempting to use ZK 5.0.8/5.0.9 EE

      Users environment

      • We have the RequestContextListener and ContextLoaderListener registered in our web.xml
      • In zk.xml, we don't have the event thread enabled, so I'm assuming it is now disabled by default
      • The ui-factory-class in zk.xml is configured as org.zkoss.zk.ui.http.SerializableUIFactory
      • We have one session scoped Spring managed bean that seems to be causing the issue.
      • We aren't utilizing any the custom zk scopes yet.
      • We are running Tomcat 7 often clustered with an Apache front end.

      configuration and some source code are attached.

      Users Class Structure

      @Named
      @Scope("session")
      public class UserWorkspace implements Serializable{
      }
      
      public abstract class BaseController extends GenericForwardComposer{
        @Inject
        protected UserWorkspace userWorkspace;
      }
      
      @Named
      @Scope("prototype")
      public class HomeMainPanelController extends BaseController implements
          EventListener{
      }
      

        1. wiring-issue.war
          15 kB
          hawk

            henrichen henrichen
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: