Vaadin + Spring. How to keep session while redeploy?

Is it possible to keep session alive while redeploy of vaadin application? After redeploy user gets this red “Session Expired” window.
I’m using Sptring and Spring Security too.

I use this AutowiringApplicationServlet : http://dev.vaadin.com/attachment/ticket/4132/AutowiringApplicationServlet.java

Tell me if I do it right :

My components are spring components with “prototype” scope


@org.springframework.stereotype.Component
@Scope("prototype")
public class QuickResponsePanel extends Panel {

in master component I just do :


    @Autowired
    private QuickResponsePanel quickResponsePanel;

or


this.applicationContext.getBean(PictureGalleryWindow.class);

I get other application components (busiess logic) session or singleton scoped in Vaadin components like this


    @Autowired
    private transient UserStateManager userStatemanager;

The “transient” shoud make this field not serialized in session.

I didn’t decided to use Tomcat or Jetty yet. It appears that Jetty works faster.

Tell me - how do you redeploy production Vaadin applications with minor changes? Users shouldn’t see this redeployment.

//EDIT:

Some further information :
I have session persistence configured. It looks like it works fine with jsp pages and spring security :

  1. I log in
  2. I open restricted jsp page
  3. Server restart
  4. I’m still authenticated and can see restricted page

Everything stops working if I open Vaadin Application. I get an exception during restart :


2010-06-25 09:35:55.796:WARN::Problem restoring session 1nl2hpbkxbreyrhvopi37oqch
java.lang.IllegalStateException: Cannot deserialize BeanFactory with id org.springframework.web.context.WebApplicationContext:/BildChat2: no factory registered for this id
        at org.springframework.beans.factory.support.DefaultListableBeanFactory$SerializedBeanFactoryReference.readResolve(DefaultListableBeanFactory.java:955)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
        at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
        at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.readObject(SharedEntityManagerCreator.java:267)
......