Skip to content

not serializable classes in Vaadin 25 #23123

Closed

Description

@jorgheymans

Description of the bug

Loading the homepage of a test application after migrating to Vaadin 25, we're seeing a number of not serializable classes which seem to originate in Vaadin core itself, as far as I can tell.

java.io.NotSerializableException: java.util.concurrent.ThreadPoolExecutor$AbortPolicy
	- field (class "org.springframework.scheduling.concurrent.ExecutorConfigurationSupport", name: "rejectedExecutionHandler", type: "interface java.util.concurrent.RejectedExecutionHandler")
	- object (class "org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor", org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor@282591ab)
	- field (class "com.vaadin.flow.server.VaadinService", name: "executor", type: "interface java.util.concurrent.Executor")
	- object (class "com.vaadin.flow.spring.SpringVaadinServletService", com.vaadin.flow.spring.SpringVaadinServletService@2cf88ae5)
	- element of array (index: 1)
	- array (class "[Ljava.lang.Object;", size: 3)
	- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
	- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.StyleSheetHotswapper, functionalInterfaceMethod=com/vaadin/flow/router/AfterNavigationListener.afterNavigation:(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, implementation=invokeVirtual com/vaadin/flow/component/internal/StyleSheetHotswapper.lambda$onInit$79e04baf$1:(Lcom/vaadin/flow/server/VaadinService;Lcom/vaadin/flow/internal/ActiveStyleSheetTracker;Lcom/vaadin/flow/router/AfterNavigationEvent;)V, instantiatedMethodType=(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, numCaptured=3])
	- custom writeObject data (class "java.util.ArrayList")
	- object (class "java.util.ArrayList", [com.vaadin.flow.component.internal.StyleSheetHotswapper$$Lambda/0x00007d78e52774a0@1bfc3bb2, eu.olaf.afis.acd.vaadin.internal.usagestatistics.PageViewStatisticEventPublisher@ce79b2a, eu.olaf.afis.acd.vaadin.internal.metrics.PageViewMeter@2a4a26ab, com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3])
	- element of array (index: 0)
	- array (class "[Ljava.lang.Object;", size: 2)
	- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
	- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.UIInternals, functionalInterfaceMethod=com/vaadin/flow/shared/Registration.remove:()V, implementation=invokeStatic com/vaadin/flow/component/internal/UIInternals.lambda$addListener$3630f8ab$1:(Ljava/util/List;Ljava/lang/Object;)V, instantiatedMethodType=()V, numCaptured=2])
	- field (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", name: "afterNavigationListener", type: "interface com.vaadin.flow.shared.Registration")
	- object (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3)
	- custom writeObject data (class "java.util.HashMap")
	- object (class "java.util.HashMap", {com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener=com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3})
	- field (class "com.vaadin.flow.server.Attributes", name: "attributes", type: "class java.util.HashMap")
	- object (class "com.vaadin.flow.server.Attributes", com.vaadin.flow.server.Attributes@10ef79c)
	- field (class "com.vaadin.flow.component.Component", name: "attributes", type: "class com.vaadin.flow.server.Attributes")
	- custom writeObject data (class "com.vaadin.flow.component.Component")
	- object (class "com.vaadin.flow.component.UI", com.vaadin.flow.component.UI@73eb8e35)
	- custom writeObject data (class "java.util.HashMap")
	- object (class "java.util.HashMap", {0=com.vaadin.flow.component.UI@73eb8e35})
	- custom writeObject data (class "com.vaadin.flow.server.VaadinSession")
	- object (class "com.vaadin.flow.server.VaadinSession", com.vaadin.flow.server.VaadinSession@73d45d07)
	- custom writeObject data (class "java.util.HashMap")
	- root object (class "java.util.HashMap", {com.vaadin.flow.server.VaadinSession.springServlet=com.vaadin.flow.server.VaadinSession@73d45d07, springServlet.lock=java.util.concurrent.locks.ReentrantLock@5ea50952[Unlocked], org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@78cdb5d0, clusterKey=1ebfd98f-5d44-4d4d-ac71-a02669f373fe_SOURCE:7D4A880715018CF7B10F29D773F71C15})
	at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1198)
	at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:358)
	at com.vaadin.kubernetes.starter.sessiontracker.serialization.TransientInjectableObjectOutputStream.writeWithTransients(TransientInjectableObjectOutputStream.java:196)
	at com.vaadin.kubernetes.starter.sessiontracker.SessionSerializer.doSerialize(SessionSerializer.java:667)
	at com.vaadin.kubernetes.starter.sessiontracker.SessionSerializer.serializeOptimisticLocking(SessionSerializer.java:581)
	at com.vaadin.kubernetes.starter.sessiontracker.SessionSerializer.handleSessionSerialization(SessionSerializer.java:411)
	at com.vaadin.kubernetes.starter.sessiontracker.SessionSerializer.lambda$queueSerialization$4(SessionSerializer.java:371)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire$$$capture(CompletableFuture.java:911)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1810)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2026-01-07T15:15:08.651+01:00  INFO  659421 --- [smoketest_be] [nio-8080-exec-7] s.s.s.d.SerializationDebugRequestHandler : Session serialization attempt finished in 125 ms with outcomes: [SERIALIZATION_FAILED, NOT_SERIALIZABLE_CLASSES]

NOT SERIALIZABLE CLASSES FOUND:
===============================

com.vaadin.flow.component.internal.StyleSheetHotswapper
	Start Track ID: 88, Stack depth: 13. Reference stack: 
		- element of array (index: 0)
		- array (class "[Ljava.lang.Object;", size: 3)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.StyleSheetHotswapper, functionalInterfaceMethod=com/vaadin/flow/router/AfterNavigationListener.afterNavigation:(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, implementation=invokeVirtual com/vaadin/flow/component/internal/StyleSheetHotswapper.lambda$onInit$79e04baf$1:(Lcom/vaadin/flow/server/VaadinService;Lcom/vaadin/flow/internal/ActiveStyleSheetTracker;Lcom/vaadin/flow/router/AfterNavigationEvent;)V, instantiatedMethodType=(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, numCaptured=3])
		- custom writeObject data (class "java.util.ArrayList")
		- object (class "java.util.ArrayList", [com.vaadin.flow.component.internal.StyleSheetHotswapper$$Lambda/0x00007d78e52774a0@1bfc3bb2, eu.olaf.afis.acd.vaadin.internal.usagestatistics.PageViewStatisticEventPublisher@ce79b2a, eu.olaf.afis.acd.vaadin.internal.metrics.PageViewMeter@2a4a26ab, com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3])
		- element of array (index: 0)
		- array (class "[Ljava.lang.Object;", size: 2)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.UIInternals, functionalInterfaceMethod=com/vaadin/flow/shared/Registration.remove:()V, implementation=invokeStatic com/vaadin/flow/component/internal/UIInternals.lambda$addListener$3630f8ab$1:(Ljava/util/List;Ljava/lang/Object;)V, instantiatedMethodType=()V, numCaptured=2])
		- field (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", name: "afterNavigationListener", type: "interface com.vaadin.flow.shared.Registration")
		- object (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener=com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3})
		- field (class "com.vaadin.flow.server.Attributes", name: "attributes", type: "class java.util.HashMap")
		- object (class "com.vaadin.flow.server.Attributes", com.vaadin.flow.server.Attributes@10ef79c)
		- field (class "com.vaadin.flow.component.Component", name: "attributes", type: "class com.vaadin.flow.server.Attributes")
		- custom writeObject data (class "com.vaadin.flow.component.Component")
		- object (class "com.vaadin.flow.component.UI", com.vaadin.flow.component.UI@73eb8e35)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {0=com.vaadin.flow.component.UI@73eb8e35})
		- custom writeObject data (class "com.vaadin.flow.server.VaadinSession")
		- object (class "com.vaadin.flow.server.VaadinSession", com.vaadin.flow.server.VaadinSession@73d45d07)
		- custom writeObject data (class "java.util.HashMap")
		- root object (class "java.util.HashMap", {com.vaadin.flow.server.VaadinSession.springServlet=com.vaadin.flow.server.VaadinSession@73d45d07, springServlet.lock=java.util.concurrent.locks.ReentrantLock@5ea50952[Unlocked], org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@78cdb5d0, clusterKey=1ebfd98f-5d44-4d4d-ac71-a02669f373fe_SOURCE:7D4A880715018CF7B10F29D773F71C15})
	End Track ID: 88
	
org.springframework.boot.tomcat.TomcatEmbeddedWebappClassLoader
	Start Track ID: 106, Stack depth: 14. Reference stack: 
		- field (class "com.vaadin.flow.server.VaadinService", name: "classLoader", type: "class java.lang.ClassLoader")
		- object (class "com.vaadin.flow.spring.SpringVaadinServletService", com.vaadin.flow.spring.SpringVaadinServletService@2cf88ae5)
		- element of array (index: 1)
		- array (class "[Ljava.lang.Object;", size: 3)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.StyleSheetHotswapper, functionalInterfaceMethod=com/vaadin/flow/router/AfterNavigationListener.afterNavigation:(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, implementation=invokeVirtual com/vaadin/flow/component/internal/StyleSheetHotswapper.lambda$onInit$79e04baf$1:(Lcom/vaadin/flow/server/VaadinService;Lcom/vaadin/flow/internal/ActiveStyleSheetTracker;Lcom/vaadin/flow/router/AfterNavigationEvent;)V, instantiatedMethodType=(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, numCaptured=3])
		- custom writeObject data (class "java.util.ArrayList")
		- object (class "java.util.ArrayList", [com.vaadin.flow.component.internal.StyleSheetHotswapper$$Lambda/0x00007d78e52774a0@1bfc3bb2, eu.olaf.afis.acd.vaadin.internal.usagestatistics.PageViewStatisticEventPublisher@ce79b2a, eu.olaf.afis.acd.vaadin.internal.metrics.PageViewMeter@2a4a26ab, com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3])
		- element of array (index: 0)
		- array (class "[Ljava.lang.Object;", size: 2)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.UIInternals, functionalInterfaceMethod=com/vaadin/flow/shared/Registration.remove:()V, implementation=invokeStatic com/vaadin/flow/component/internal/UIInternals.lambda$addListener$3630f8ab$1:(Ljava/util/List;Ljava/lang/Object;)V, instantiatedMethodType=()V, numCaptured=2])
		- field (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", name: "afterNavigationListener", type: "interface com.vaadin.flow.shared.Registration")
		- object (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener=com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3})
		- field (class "com.vaadin.flow.server.Attributes", name: "attributes", type: "class java.util.HashMap")
		- object (class "com.vaadin.flow.server.Attributes", com.vaadin.flow.server.Attributes@10ef79c)
		- field (class "com.vaadin.flow.component.Component", name: "attributes", type: "class com.vaadin.flow.server.Attributes")
		- custom writeObject data (class "com.vaadin.flow.component.Component")
		- object (class "com.vaadin.flow.component.UI", com.vaadin.flow.component.UI@73eb8e35)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {0=com.vaadin.flow.component.UI@73eb8e35})
		- custom writeObject data (class "com.vaadin.flow.server.VaadinSession")
		- object (class "com.vaadin.flow.server.VaadinSession", com.vaadin.flow.server.VaadinSession@73d45d07)
		- custom writeObject data (class "java.util.HashMap")
		- root object (class "java.util.HashMap", {com.vaadin.flow.server.VaadinSession.springServlet=com.vaadin.flow.server.VaadinSession@73d45d07, springServlet.lock=java.util.concurrent.locks.ReentrantLock@5ea50952[Unlocked], org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@78cdb5d0, clusterKey=1ebfd98f-5d44-4d4d-ac71-a02669f373fe_SOURCE:7D4A880715018CF7B10F29D773F71C15})
	End Track ID: 106
	
org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext
	Start Track ID: 147, Stack depth: 15. Reference stack: 
		- field (class "org.springframework.scheduling.concurrent.ExecutorConfigurationSupport", name: "applicationContext", type: "interface org.springframework.context.ApplicationContext")
		- object (class "org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor", org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor@282591ab)
		- field (class "com.vaadin.flow.server.VaadinService", name: "executor", type: "interface java.util.concurrent.Executor")
		- object (class "com.vaadin.flow.spring.SpringVaadinServletService", com.vaadin.flow.spring.SpringVaadinServletService@2cf88ae5)
		- element of array (index: 1)
		- array (class "[Ljava.lang.Object;", size: 3)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.StyleSheetHotswapper, functionalInterfaceMethod=com/vaadin/flow/router/AfterNavigationListener.afterNavigation:(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, implementation=invokeVirtual com/vaadin/flow/component/internal/StyleSheetHotswapper.lambda$onInit$79e04baf$1:(Lcom/vaadin/flow/server/VaadinService;Lcom/vaadin/flow/internal/ActiveStyleSheetTracker;Lcom/vaadin/flow/router/AfterNavigationEvent;)V, instantiatedMethodType=(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, numCaptured=3])
		- custom writeObject data (class "java.util.ArrayList")
		- object (class "java.util.ArrayList", [com.vaadin.flow.component.internal.StyleSheetHotswapper$$Lambda/0x00007d78e52774a0@1bfc3bb2, eu.olaf.afis.acd.vaadin.internal.usagestatistics.PageViewStatisticEventPublisher@ce79b2a, eu.olaf.afis.acd.vaadin.internal.metrics.PageViewMeter@2a4a26ab, com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3])
		- element of array (index: 0)
		- array (class "[Ljava.lang.Object;", size: 2)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.UIInternals, functionalInterfaceMethod=com/vaadin/flow/shared/Registration.remove:()V, implementation=invokeStatic com/vaadin/flow/component/internal/UIInternals.lambda$addListener$3630f8ab$1:(Ljava/util/List;Ljava/lang/Object;)V, instantiatedMethodType=()V, numCaptured=2])
		- field (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", name: "afterNavigationListener", type: "interface com.vaadin.flow.shared.Registration")
		- object (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener=com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3})
		- field (class "com.vaadin.flow.server.Attributes", name: "attributes", type: "class java.util.HashMap")
		- object (class "com.vaadin.flow.server.Attributes", com.vaadin.flow.server.Attributes@10ef79c)
		- field (class "com.vaadin.flow.component.Component", name: "attributes", type: "class com.vaadin.flow.server.Attributes")
		- custom writeObject data (class "com.vaadin.flow.component.Component")
		- object (class "com.vaadin.flow.component.UI", com.vaadin.flow.component.UI@73eb8e35)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {0=com.vaadin.flow.component.UI@73eb8e35})
		- custom writeObject data (class "com.vaadin.flow.server.VaadinSession")
		- object (class "com.vaadin.flow.server.VaadinSession", com.vaadin.flow.server.VaadinSession@73d45d07)
		- custom writeObject data (class "java.util.HashMap")
		- root object (class "java.util.HashMap", {com.vaadin.flow.server.VaadinSession.springServlet=com.vaadin.flow.server.VaadinSession@73d45d07, springServlet.lock=java.util.concurrent.locks.ReentrantLock@5ea50952[Unlocked], org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@78cdb5d0, clusterKey=1ebfd98f-5d44-4d4d-ac71-a02669f373fe_SOURCE:7D4A880715018CF7B10F29D773F71C15})
	End Track ID: 147
	
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor$1
	Start Track ID: 149, Stack depth: 15. Reference stack: 
		- field (class "org.springframework.scheduling.concurrent.ExecutorConfigurationSupport", name: "executor", type: "interface java.util.concurrent.ExecutorService")
		- object (class "org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor", org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor@282591ab)
		- field (class "com.vaadin.flow.server.VaadinService", name: "executor", type: "interface java.util.concurrent.Executor")
		- object (class "com.vaadin.flow.spring.SpringVaadinServletService", com.vaadin.flow.spring.SpringVaadinServletService@2cf88ae5)
		- element of array (index: 1)
		- array (class "[Ljava.lang.Object;", size: 3)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.StyleSheetHotswapper, functionalInterfaceMethod=com/vaadin/flow/router/AfterNavigationListener.afterNavigation:(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, implementation=invokeVirtual com/vaadin/flow/component/internal/StyleSheetHotswapper.lambda$onInit$79e04baf$1:(Lcom/vaadin/flow/server/VaadinService;Lcom/vaadin/flow/internal/ActiveStyleSheetTracker;Lcom/vaadin/flow/router/AfterNavigationEvent;)V, instantiatedMethodType=(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, numCaptured=3])
		- custom writeObject data (class "java.util.ArrayList")
		- object (class "java.util.ArrayList", [com.vaadin.flow.component.internal.StyleSheetHotswapper$$Lambda/0x00007d78e52774a0@1bfc3bb2, eu.olaf.afis.acd.vaadin.internal.usagestatistics.PageViewStatisticEventPublisher@ce79b2a, eu.olaf.afis.acd.vaadin.internal.metrics.PageViewMeter@2a4a26ab, com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3])
		- element of array (index: 0)
		- array (class "[Ljava.lang.Object;", size: 2)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.UIInternals, functionalInterfaceMethod=com/vaadin/flow/shared/Registration.remove:()V, implementation=invokeStatic com/vaadin/flow/component/internal/UIInternals.lambda$addListener$3630f8ab$1:(Ljava/util/List;Ljava/lang/Object;)V, instantiatedMethodType=()V, numCaptured=2])
		- field (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", name: "afterNavigationListener", type: "interface com.vaadin.flow.shared.Registration")
		- object (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener=com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3})
		- field (class "com.vaadin.flow.server.Attributes", name: "attributes", type: "class java.util.HashMap")
		- object (class "com.vaadin.flow.server.Attributes", com.vaadin.flow.server.Attributes@10ef79c)
		- field (class "com.vaadin.flow.component.Component", name: "attributes", type: "class com.vaadin.flow.server.Attributes")
		- custom writeObject data (class "com.vaadin.flow.component.Component")
		- object (class "com.vaadin.flow.component.UI", com.vaadin.flow.component.UI@73eb8e35)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {0=com.vaadin.flow.component.UI@73eb8e35})
		- custom writeObject data (class "com.vaadin.flow.server.VaadinSession")
		- object (class "com.vaadin.flow.server.VaadinSession", com.vaadin.flow.server.VaadinSession@73d45d07)
		- custom writeObject data (class "java.util.HashMap")
		- root object (class "java.util.HashMap", {com.vaadin.flow.server.VaadinSession.springServlet=com.vaadin.flow.server.VaadinSession@73d45d07, springServlet.lock=java.util.concurrent.locks.ReentrantLock@5ea50952[Unlocked], org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@78cdb5d0, clusterKey=1ebfd98f-5d44-4d4d-ac71-a02669f373fe_SOURCE:7D4A880715018CF7B10F29D773F71C15})
	End Track ID: 149
	
org.springframework.scheduling.concurrent.ExecutorLifecycleDelegate
	Start Track ID: 150, Stack depth: 15. Reference stack: 
		- field (class "org.springframework.scheduling.concurrent.ExecutorConfigurationSupport", name: "lifecycleDelegate", type: "class org.springframework.scheduling.concurrent.ExecutorLifecycleDelegate")
		- object (class "org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor", org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor@282591ab)
		- field (class "com.vaadin.flow.server.VaadinService", name: "executor", type: "interface java.util.concurrent.Executor")
		- object (class "com.vaadin.flow.spring.SpringVaadinServletService", com.vaadin.flow.spring.SpringVaadinServletService@2cf88ae5)
		- element of array (index: 1)
		- array (class "[Ljava.lang.Object;", size: 3)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.StyleSheetHotswapper, functionalInterfaceMethod=com/vaadin/flow/router/AfterNavigationListener.afterNavigation:(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, implementation=invokeVirtual com/vaadin/flow/component/internal/StyleSheetHotswapper.lambda$onInit$79e04baf$1:(Lcom/vaadin/flow/server/VaadinService;Lcom/vaadin/flow/internal/ActiveStyleSheetTracker;Lcom/vaadin/flow/router/AfterNavigationEvent;)V, instantiatedMethodType=(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, numCaptured=3])
		- custom writeObject data (class "java.util.ArrayList")
		- object (class "java.util.ArrayList", [com.vaadin.flow.component.internal.StyleSheetHotswapper$$Lambda/0x00007d78e52774a0@1bfc3bb2, eu.olaf.afis.acd.vaadin.internal.usagestatistics.PageViewStatisticEventPublisher@ce79b2a, eu.olaf.afis.acd.vaadin.internal.metrics.PageViewMeter@2a4a26ab, com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3])
		- element of array (index: 0)
		- array (class "[Ljava.lang.Object;", size: 2)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.UIInternals, functionalInterfaceMethod=com/vaadin/flow/shared/Registration.remove:()V, implementation=invokeStatic com/vaadin/flow/component/internal/UIInternals.lambda$addListener$3630f8ab$1:(Ljava/util/List;Ljava/lang/Object;)V, instantiatedMethodType=()V, numCaptured=2])
		- field (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", name: "afterNavigationListener", type: "interface com.vaadin.flow.shared.Registration")
		- object (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener=com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3})
		- field (class "com.vaadin.flow.server.Attributes", name: "attributes", type: "class java.util.HashMap")
		- object (class "com.vaadin.flow.server.Attributes", com.vaadin.flow.server.Attributes@10ef79c)
		- field (class "com.vaadin.flow.component.Component", name: "attributes", type: "class com.vaadin.flow.server.Attributes")
		- custom writeObject data (class "com.vaadin.flow.component.Component")
		- object (class "com.vaadin.flow.component.UI", com.vaadin.flow.component.UI@73eb8e35)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {0=com.vaadin.flow.component.UI@73eb8e35})
		- custom writeObject data (class "com.vaadin.flow.server.VaadinSession")
		- object (class "com.vaadin.flow.server.VaadinSession", com.vaadin.flow.server.VaadinSession@73d45d07)
		- custom writeObject data (class "java.util.HashMap")
		- root object (class "java.util.HashMap", {com.vaadin.flow.server.VaadinSession.springServlet=com.vaadin.flow.server.VaadinSession@73d45d07, springServlet.lock=java.util.concurrent.locks.ReentrantLock@5ea50952[Unlocked], org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@78cdb5d0, clusterKey=1ebfd98f-5d44-4d4d-ac71-a02669f373fe_SOURCE:7D4A880715018CF7B10F29D773F71C15})
	End Track ID: 150
	
org.apache.commons.logging.impl.Slf4jLogFactory$Slf4jLocationAwareLog
	Start Track ID: 151, Stack depth: 15. Reference stack: 
		- field (class "org.springframework.scheduling.concurrent.ExecutorConfigurationSupport", name: "logger", type: "interface org.apache.commons.logging.Log")
		- object (class "org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor", org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor@282591ab)
		- field (class "com.vaadin.flow.server.VaadinService", name: "executor", type: "interface java.util.concurrent.Executor")
		- object (class "com.vaadin.flow.spring.SpringVaadinServletService", com.vaadin.flow.spring.SpringVaadinServletService@2cf88ae5)
		- element of array (index: 1)
		- array (class "[Ljava.lang.Object;", size: 3)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.StyleSheetHotswapper, functionalInterfaceMethod=com/vaadin/flow/router/AfterNavigationListener.afterNavigation:(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, implementation=invokeVirtual com/vaadin/flow/component/internal/StyleSheetHotswapper.lambda$onInit$79e04baf$1:(Lcom/vaadin/flow/server/VaadinService;Lcom/vaadin/flow/internal/ActiveStyleSheetTracker;Lcom/vaadin/flow/router/AfterNavigationEvent;)V, instantiatedMethodType=(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, numCaptured=3])
		- custom writeObject data (class "java.util.ArrayList")
		- object (class "java.util.ArrayList", [com.vaadin.flow.component.internal.StyleSheetHotswapper$$Lambda/0x00007d78e52774a0@1bfc3bb2, eu.olaf.afis.acd.vaadin.internal.usagestatistics.PageViewStatisticEventPublisher@ce79b2a, eu.olaf.afis.acd.vaadin.internal.metrics.PageViewMeter@2a4a26ab, com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3])
		- element of array (index: 0)
		- array (class "[Ljava.lang.Object;", size: 2)
		- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
		- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.UIInternals, functionalInterfaceMethod=com/vaadin/flow/shared/Registration.remove:()V, implementation=invokeStatic com/vaadin/flow/component/internal/UIInternals.lambda$addListener$3630f8ab$1:(Ljava/util/List;Ljava/lang/Object;)V, instantiatedMethodType=()V, numCaptured=2])
		- field (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", name: "afterNavigationListener", type: "interface com.vaadin.flow.shared.Registration")
		- object (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener=com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3})
		- field (class "com.vaadin.flow.server.Attributes", name: "attributes", type: "class java.util.HashMap")
		- object (class "com.vaadin.flow.server.Attributes", com.vaadin.flow.server.Attributes@10ef79c)
		- field (class "com.vaadin.flow.component.Component", name: "attributes", type: "class com.vaadin.flow.server.Attributes")
		- custom writeObject data (class "com.vaadin.flow.component.Component")
		- object (class "com.vaadin.flow.component.UI", com.vaadin.flow.component.UI@73eb8e35)
		- custom writeObject data (class "java.util.HashMap")
		- object (class "java.util.HashMap", {0=com.vaadin.flow.component.UI@73eb8e35})
		- custom writeObject data (class "com.vaadin.flow.server.VaadinSession")
		- object (class "com.vaadin.flow.server.VaadinSession", com.vaadin.flow.server.VaadinSession@73d45d07)
		- custom writeObject data (class "java.util.HashMap")
		- root object (class "java.util.HashMap", {com.vaadin.flow.server.VaadinSession.springServlet=com.vaadin.flow.server.VaadinSession@73d45d07, springServlet.lock=java.util.concurrent.locks.ReentrantLock@5ea50952[Unlocked], org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@78cdb5d0, clusterKey=1ebfd98f-5d44-4d4d-ac71-a02669f373fe_SOURCE:7D4A880715018CF7B10F29D773F71C15})
	End Track ID: 151
	
2026-01-07T15:15:08.836+01:00 ERROR  659421 --- [smoketest_be] [er-2037169852-2] c.v.k.s.s.SessionSerializer              : Optimistic serialization of session DEBUG-SERIALIZE-7D4A880715018CF7B10F29D773F71C15 with distributed key 124088ca-a35c-4d5e-a8df-c4422d167fd4_SOURCE:7D4A880715018CF7B10F29D773F71C15 failed, some attribute is not serializable. Giving up immediately since the error is not recoverable

java.io.NotSerializableException: java.util.concurrent.ThreadPoolExecutor$AbortPolicy
	- field (class "org.springframework.scheduling.concurrent.ExecutorConfigurationSupport", name: "rejectedExecutionHandler", type: "interface java.util.concurrent.RejectedExecutionHandler")
	- object (class "org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor", org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor@282591ab)
	- field (class "com.vaadin.flow.server.VaadinService", name: "executor", type: "interface java.util.concurrent.Executor")
	- object (class "com.vaadin.flow.spring.SpringVaadinServletService", com.vaadin.flow.spring.SpringVaadinServletService@2cf88ae5)
	- element of array (index: 1)
	- array (class "[Ljava.lang.Object;", size: 3)
	- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
	- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.StyleSheetHotswapper, functionalInterfaceMethod=com/vaadin/flow/router/AfterNavigationListener.afterNavigation:(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, implementation=invokeVirtual com/vaadin/flow/component/internal/StyleSheetHotswapper.lambda$onInit$79e04baf$1:(Lcom/vaadin/flow/server/VaadinService;Lcom/vaadin/flow/internal/ActiveStyleSheetTracker;Lcom/vaadin/flow/router/AfterNavigationEvent;)V, instantiatedMethodType=(Lcom/vaadin/flow/router/AfterNavigationEvent;)V, numCaptured=3])
	- custom writeObject data (class "java.util.ArrayList")
	- object (class "java.util.ArrayList", [com.vaadin.flow.component.internal.StyleSheetHotswapper$$Lambda/0x00007d78e52774a0@1bfc3bb2, eu.olaf.afis.acd.vaadin.internal.usagestatistics.PageViewStatisticEventPublisher@ce79b2a, eu.olaf.afis.acd.vaadin.internal.metrics.PageViewMeter@2a4a26ab, com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3])
	- element of array (index: 0)
	- array (class "[Ljava.lang.Object;", size: 2)
	- field (class "java.lang.invoke.SerializedLambda", name: "capturedArgs", type: "class [Ljava.lang.Object;")
	- object (class "java.lang.invoke.SerializedLambda", SerializedLambda[capturingClass=class com.vaadin.flow.component.internal.UIInternals, functionalInterfaceMethod=com/vaadin/flow/shared/Registration.remove:()V, implementation=invokeStatic com/vaadin/flow/component/internal/UIInternals.lambda$addListener$3630f8ab$1:(Ljava/util/List;Ljava/lang/Object;)V, instantiatedMethodType=()V, numCaptured=2])
	- field (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", name: "afterNavigationListener", type: "interface com.vaadin.flow.shared.Registration")
	- object (class "com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener", com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3)
	- custom writeObject data (class "java.util.HashMap")
	- object (class "java.util.HashMap", {com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener=com.vaadin.flow.spring.scopes.VaadinRouteScope$NavigationListener@1e3563e3})
	- field (class "com.vaadin.flow.server.Attributes", name: "attributes", type: "class java.util.HashMap")
	- object (class "com.vaadin.flow.server.Attributes", com.vaadin.flow.server.Attributes@10ef79c)
	- field (class "com.vaadin.flow.component.Component", name: "attributes", type: "class com.vaadin.flow.server.Attributes")
	- custom writeObject data (class "com.vaadin.flow.component.Component")
	- object (class "com.vaadin.flow.component.UI", com.vaadin.flow.component.UI@73eb8e35)
	- custom writeObject data (class "java.util.HashMap")
	- object (class "java.util.HashMap", {0=com.vaadin.flow.component.UI@73eb8e35})
	- custom writeObject data (class "com.vaadin.flow.server.VaadinSession")
	- object (class "com.vaadin.flow.server.VaadinSession", com.vaadin.flow.server.VaadinSession@73d45d07)
	- custom writeObject data (class "java.util.HashMap")
	- root object (class "java.util.HashMap", {com.vaadin.flow.server.VaadinSession.springServlet=com.vaadin.flow.server.VaadinSession@73d45d07, springServlet.lock=java.util.concurrent.locks.ReentrantLock@5ea50952[Unlocked], org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@78cdb5d0, clusterKey=124088ca-a35c-4d5e-a8df-c4422d167fd4_SOURCE:7D4A880715018CF7B10F29D773F71C15})
	at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1198)
com.vaadin.kubernetes.starter.sessiontracker.serialization.TransientInjectableObjectOutputStream.writeWithTransients(TransientInjectableObjectOutputStream.java:196)
	at com.vaadin.kubernetes.starter.sessiontracker.SessionSerializer.doSerialize(SessionSerializer.java:667)
	at com.vaadin.kubernetes.starter.sessiontracker.SessionSerializer.serializeOptimisticLocking(SessionSerializer.java:581)
	at com.vaadin.kubernetes.starter.sessiontracker.SessionSerializer.handleSessionSerialization(SessionSerializer.java:411)
	at com.vaadin.kubernetes.starter.sessiontracker.SessionSerializer.lambda$queueSerialization$4(SessionSerializer.java:371)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire$$$capture(CompletableFuture.java:911)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1810)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Expected behavior

Vaadin classes should be serializable when appropriate.

Minimal reproducible example

Unfortunately, I am unable to reproduce this in a plain vaadin starter demo application.

Versions

  • Vaadin / Flow version: 25.0.2
  • Java version: 21

Activity

  1. mcollovati commented on Jan 7, 2026

    @mcollovati
    Collaborator

    At a first look com.vaadin.flow.component.internal.StyleSheetHotswapper seems the culprit, but it is a dev only dependency and should never be stored in the HTTP session.
    It is indeed a bug: StyleSheetHotswapper registers some UI listeners that captures itself.

    The other classes reported by the debug tool are all related to StyleSheetHotswapper since it keeps a reference to VaadinService.

  2. added theissue type on Jan 7, 2026
  3. jorgheymans commented on Jan 7, 2026

    @jorgheymans
    ContributorAuthor

    Thanks for confirming, we would then only get this during local development if I understand correctly.

  4. mcollovati commented on Jan 7, 2026

    @mcollovati
    Collaborator

    Thanks for confirming, we would then only get this during local development if I understand correctly.

    Exactly. Only on local development and only if using Hotswap agent or JRebel (Hotswappers are initialized only when using those tools)

  5. mstahv commented on Jan 9, 2026

    @mstahv
    Member

    I have sometimes made poor man's session size estimations by serializing session/ui and then evaluating its size. I faced this issue a quite recently with such app when trying to upgrade to v25. Would be great to have this fixed somehow 👍

  6. added a commit that references this issue on Jan 9, 2026
    32acabb
  7. moved this to 🔖 Low Priority (P3) in Vaadin Flow bugs & maintenanceon Jan 9, 2026
  8. added a commit that references this issue on Jan 9, 2026
    822f3de
  9. moved this from 🔖 Low Priority (P3) to ✅ Closed in Vaadin Flow bugs & maintenanceon Jan 9, 2026
  10. added 2 commits that reference this issue on Jan 9, 2026
    379104d
    dcd5e70
  11. added a commit that references this issue on Jan 9, 2026
    0304d35
  12. vaadin-bot commented on Jan 13, 2026

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with Vaadin 25.1.0-alpha1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions