Hi all,
I have inherited a Vaadin application. I managed to upgrade it to the latest 7.7.x version (upgrading to 8 will come later).
Right now I’m trying to setup a HA setup, where a Vaadin application would run on multiple nodes. To do so I’d need to save the sessions to file (NFS) o to a datastore (SQL, redis, memcached, etc).
However, saving the session seems to fail. I enabled the Manager className=… in the Tomcat’s context.xml. Doing that showed me that Tomcat was unable to save/restore the sessions. I enabled -Dsun.io.serialization.extendedDebugInfo=true on the Tomcat server to see what was going on and found this:
20:55:02.612 [main]
WARN com.vaadin.event.ListenerMethod - Error in serialization of the application: Class com.gusi.app.backoffice.ui.UserInterface$$Lambda$79/1713903507 must implement serialization.
20:55:02.618 [main]
WARN o.a.c.c.C.[.[.
[/backoffice]
- Cannot serialize session attribute [com.vaadin.server.VaadinSession.springVaadinServlet]
for session [4A0B163025B0DE2C2929163D29589FEE]
java.io.NotSerializableException: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext
- field (class "com.gusi.app.backoffice.ui.smart.SmartViewProvider", name: "applicationContext", type: "interface org.springframework.context.ApplicationContext")
- object (class "com.gusi.app.backoffice.ui.smart.SmartViewProvider", com.gusi.app.backoffice.ui.smart.SmartViewProvider@622a3566)
- custom writeObject data (class "java.util.LinkedList")
- object (class "java.util.LinkedList", [com.vaadin.spring.navigator.SpringViewProvider@2b759ab1, com.gusi.app.backoffice.ui.smart.SmartViewProvider@622a3566]
)
- field (class "com.vaadin.navigator.Navigator", name: "providers", type: "interface java.util.List")
- object (class "com.gusi.app.backoffice.ui.smart.SmartNavigator", com.gusi.app.backoffice.ui.smart.SmartNavigator@784c3487)
- field (class "com.vaadin.ui.UI", name: "navigator", type: "class com.vaadin.navigator.Navigator")
The UserInterface class has some Button and other Vaadin widgets that declare a click listener with a lambda function. I’ve been checking how to overcome this, but I’ve failed. Does anybody know how to serialize the user interface if it contains buttons? Or how to avoid the serialization of the interface state at all?
Best