flow icon indicating copy to clipboard operation
flow copied to clipboard

Strange behavior when adding spring boot starter & testcontainers

Open salaboy opened this issue 6 months ago • 12 comments

Description of the bug

Hi folks, I am trying to create a simple example of vaadin and testcontainers, in this case using Redis and Spring Data Redis:

https://github.com/salaboy/vaadin-demo

For some reason, when I start this app, vaadin goes into a loop (in the browser). I've checked the configurations several times, but I am sure I am missing something.

Image

I've excluded hilla, and I am running the app with mvn spring-boot:test-run as I want the test configuration to start when I start my app.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.5.0)

2025-06-09T11:32:28.053+08:00  INFO 67041 --- [demo] [  restartedMain] com.example.demo.DemoApplication         : Starting DemoApplication using Java 21.0.5 with PID 67041 (/Users/salaboy/code/salaboy/vaadin-demo/target/classes started by salaboy in /Users/salaboy/code/salaboy/vaadin-demo)
2025-06-09T11:32:28.054+08:00  INFO 67041 --- [demo] [  restartedMain] com.example.demo.DemoApplication         : No active profile set, falling back to 1 default profile: "default"
2025-06-09T11:32:28.074+08:00  INFO 67041 --- [demo] [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2025-06-09T11:32:28.074+08:00  INFO 67041 --- [demo] [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2025-06-09T11:32:28.385+08:00  INFO 67041 --- [demo] [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2025-06-09T11:32:28.386+08:00  INFO 67041 --- [demo] [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2025-06-09T11:32:28.453+08:00  INFO 67041 --- [demo] [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 58 ms. Found 1 Redis repository interface.
2025-06-09T11:32:28.673+08:00  INFO 67041 --- [demo] [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2025-06-09T11:32:28.679+08:00  INFO 67041 --- [demo] [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2025-06-09T11:32:28.680+08:00  INFO 67041 --- [demo] [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.41]
2025-06-09T11:32:28.700+08:00  INFO 67041 --- [demo] [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2025-06-09T11:32:28.701+08:00  INFO 67041 --- [demo] [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 627 ms
2025-06-09T11:32:33.673+08:00  INFO 67041 --- [demo] [  restartedMain] c.v.f.s.VaadinServletContextInitializer  : Search for subclasses and classes with annotations took 4880 ms
2025-06-09T11:32:33.919+08:00  INFO 67041 --- [demo] [  restartedMain] c.v.b.d.startup.DevModeStartupListener   : Starting dev-mode updaters in /Users/salaboy/code/salaboy/vaadin-demo folder.
2025-06-09T11:32:33.942+08:00  INFO 67041 --- [demo] [  restartedMain] c.v.f.s.f.s.FullDependenciesScanner      : Visited 98 classes. Took 15 ms.
2025-06-09T11:32:33.943+08:00  INFO 67041 --- [demo] [  restartedMain] c.v.f.s.frontend.BundleValidationUtil    : Checking if a development mode bundle build is needed
2025-06-09T11:32:33.994+08:00  INFO 67041 --- [demo] [  restartedMain] c.v.f.s.frontend.BundleValidationUtil    : A development mode bundle build is not needed
2025-06-09T11:32:34.008+08:00  INFO 67041 --- [demo] [in-dev-server-1] c.v.f.s.frontend.TaskCopyFrontendFiles   : Copying frontend resources from jar files ...
2025-06-09T11:32:34.025+08:00  INFO 67041 --- [demo] [  restartedMain] org.testcontainers.images.PullPolicy     : Image pull policy will be performed by: DefaultPullPolicy()
2025-06-09T11:32:34.026+08:00  INFO 67041 --- [demo] [  restartedMain] o.t.utility.ImageNameSubstitutor         : Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2025-06-09T11:32:34.037+08:00  INFO 67041 --- [demo] [  restartedMain] org.testcontainers.DockerClientFactory   : Testcontainers version: 1.21.0
2025-06-09T11:32:34.045+08:00  INFO 67041 --- [demo] [in-dev-server-1] c.v.f.s.frontend.TaskCopyFrontendFiles   : Visited 19 resources. Took 36 ms.
2025-06-09T11:32:34.146+08:00  INFO 67041 --- [demo] [  restartedMain] o.t.d.DockerClientProviderStrategy       : Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2025-06-09T11:32:34.154+08:00  WARN 67041 --- [demo] [  restartedMain] o.t.d.DockerClientProviderStrategy       : DOCKER_HOST tcp://127.0.0.1:53210 is not listening

java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.connect0(Native Method) ~[na:na]
	at java.base/sun.nio.ch.Net.connect(Net.java:589) ~[na:na]
	at java.base/sun.nio.ch.Net.connect(Net.java:578) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:583) ~[na:na]
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:751) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:686) ~[na:na]
	at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$test$3(DockerClientProviderStrategy.java:214) ~[testcontainers-1.21.0.jar:1.21.0]
	at org.testcontainers.shaded.org.awaitility.core.AssertionCondition.lambda$new$0(AssertionCondition.java:53) ~[testcontainers-1.21.0.jar:1.21.0]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248) ~[testcontainers-1.21.0.jar:1.21.0]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235) ~[testcontainers-1.21.0.jar:1.21.0]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

2025-06-09T11:32:34.156+08:00  WARN 67041 --- [demo] [  restartedMain] o.t.d.DockerClientProviderStrategy       : DOCKER_HOST tcp://127.0.0.1:53210 is not listening

java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.connect0(Native Method) ~[na:na]
	at java.base/sun.nio.ch.Net.connect(Net.java:589) ~[na:na]
	at java.base/sun.nio.ch.Net.connect(Net.java:578) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:583) ~[na:na]
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:751) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:686) ~[na:na]
	at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$test$3(DockerClientProviderStrategy.java:214) ~[testcontainers-1.21.0.jar:1.21.0]
	at org.testcontainers.shaded.org.awaitility.core.AssertionCondition.lambda$new$0(AssertionCondition.java:53) ~[testcontainers-1.21.0.jar:1.21.0]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248) ~[testcontainers-1.21.0.jar:1.21.0]
	at org.testcontainers.shaded.org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235) ~[testcontainers-1.21.0.jar:1.21.0]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

2025-06-09T11:32:34.299+08:00  INFO 67041 --- [demo] [  restartedMain] o.t.d.DockerClientProviderStrategy       : Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2025-06-09T11:32:34.300+08:00  INFO 67041 --- [demo] [  restartedMain] org.testcontainers.DockerClientFactory   : Docker host IP address is localhost
2025-06-09T11:32:34.309+08:00  INFO 67041 --- [demo] [  restartedMain] org.testcontainers.DockerClientFactory   : Connected to docker: 
  Server Version: 28.1.1
  API Version: 1.49
  Operating System: Docker Desktop
  Total Memory: 48595 MB
  Labels: 
    com.docker.desktop.address=unix:///Users/salaboy/Library/Containers/com.docker.docker/Data/docker-cli.sock
2025-06-09T11:32:34.313+08:00  INFO 67041 --- [demo] [  restartedMain] org.testcontainers.DockerClientFactory   : Checking the system...
2025-06-09T11:32:34.313+08:00  INFO 67041 --- [demo] [  restartedMain] org.testcontainers.DockerClientFactory   : ✔︎ Docker server version should be at least 1.6.0
2025-06-09T11:32:34.340+08:00  INFO 67041 --- [demo] [  restartedMain] tc.redis:latest                          : Creating container for image: redis:latest
2025-06-09T11:32:34.453+08:00  INFO 67041 --- [demo] [  restartedMain] tc.testcontainers/ryuk:0.11.0            : Creating container for image: testcontainers/ryuk:0.11.0
2025-06-09T11:32:34.507+08:00  INFO 67041 --- [demo] [  restartedMain] tc.testcontainers/ryuk:0.11.0            : Container testcontainers/ryuk:0.11.0 is starting: 6ab86b6082f9dd67a65c1e4ed23a3151e28ac247119a69ac7e14bcb4bf0d305b
2025-06-09T11:32:34.650+08:00  INFO 67041 --- [demo] [  restartedMain] tc.testcontainers/ryuk:0.11.0            : Container testcontainers/ryuk:0.11.0 started in PT0.196581S
2025-06-09T11:32:34.689+08:00  INFO 67041 --- [demo] [  restartedMain] tc.redis:latest                          : Container redis:latest is starting: d75539e2eec6980879a5a2853c574760f8606c13373835d968a1cb33dacde2b0
2025-06-09T11:32:34.894+08:00  INFO 67041 --- [demo] [  restartedMain] tc.redis:latest                          : Container redis:latest started in PT0.55417S
2025-06-09T11:32:35.371+08:00  INFO 67041 --- [demo] [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2025-06-09T11:32:35.578+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereHandler com.vaadin.flow.server.communication.PushAtmosphereHandler mapped to context-path: /*
2025-06-09T11:32:35.578+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.flow.server.communication.PushAtmosphereHandler
2025-06-09T11:32:35.592+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Atmosphere is using org.atmosphere.util.VoidAnnotationProcessor for processing annotation
2025-06-09T11:32:35.594+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.util.ForkJoinPool         : Using ForkJoinPool  java.util.concurrent.ForkJoinPool. Set the org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads to -1 to fully use its power.
2025-06-09T11:32:35.595+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
2025-06-09T11:32:35.602+08:00  INFO 67041 --- [demo] [  restartedMain] o.a.container.JSR356AsyncSupport         : JSR 356 Mapping path /VAADIN/push
2025-06-09T11:32:35.607+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installing Default AtmosphereInterceptors
2025-06-09T11:32:35.607+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
2025-06-09T11:32:35.607+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
2025-06-09T11:32:35.607+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
2025-06-09T11:32:35.608+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor CORS Interceptor Support with priority FIRST_BEFORE_DEFAULT 
2025-06-09T11:32:35.610+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Default Response's Headers Interceptor with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Browser Padding Interceptor Support with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Android Interceptor Support with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] o.a.interceptor.HeartbeatInterceptor     : HeartbeatInterceptor configured with padding value 'X', client frequency 0 seconds and server frequency 60 seconds
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Heartbeat Interceptor Support with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor SSE Interceptor Support with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor JSONP Interceptor Support with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Atmosphere JavaScript Protocol with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Browser disconnection detection with priority AFTER_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor org.atmosphere.interceptor.IdleResourceInterceptor with priority BEFORE_DEFAULT 
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Using EndpointMapper class org.atmosphere.util.DefaultEndpointMapper
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Broadcaster Shared List Resources: false
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Broadcaster Polling Wait Time 100
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Shared ExecutorService supported: true
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Messaging ExecutorService Pool Size unavailable - Not instance of ThreadPoolExecutor
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Async I/O Thread Pool Size: 200
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Using AtmosphereResurceFactory: org.atmosphere.cpr.DefaultAtmosphereResourceFactory
2025-06-09T11:32:35.611+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
2025-06-09T11:32:35.612+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Invoke AtmosphereInterceptor on WebSocket message true
2025-06-09T11:32:35.613+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : HttpSession supported: true
2025-06-09T11:32:35.613+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Atmosphere is using DefaultAtmosphereObjectFactory for dependency injection and object creation
2025-06-09T11:32:35.613+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Atmosphere is using async support: org.atmosphere.container.JSR356AsyncSupport running under container: Apache Tomcat/10.1.41 using jakarta.servlet/3.0 and jsr356/WebSocket API
2025-06-09T11:32:35.613+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Atmosphere Framework 3.0.5.slf4jvaadin1 started.
2025-06-09T11:32:35.614+08:00  INFO 67041 --- [demo] [  restartedMain] org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT 
2025-06-09T11:32:35.633+08:00  INFO 67041 --- [demo] [  restartedMain] c.v.f.s.DefaultDeploymentConfiguration   : 
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
2025-06-09T11:32:35.643+08:00  INFO 67041 --- [demo] [  restartedMain] c.vaadin.flow.spring.SpringInstantiator  : The number of beans implementing 'I18NProvider' is 0. Cannot use Spring beans for I18N, falling back to the default behavior
2025-06-09T11:32:35.688+08:00  INFO 67041 --- [demo] [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path '/'
2025-06-09T11:32:35.693+08:00  INFO 67041 --- [demo] [  restartedMain] com.example.demo.DemoApplication         : Started DemoApplication in 7.819 seconds (process running for 8.001)
2025-06-09T11:32:35.695+08:00  INFO 67041 --- [demo] [  restartedMain] c.v.b.d.DevModeHandlerManagerImpl        : Application running at http://localhost:8080/
2025-06-09T11:32:35.848+08:00  INFO 67041 --- [demo] [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-06-09T11:32:35.848+08:00  INFO 67041 --- [demo] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2025-06-09T11:32:35.849+08:00  INFO 67041 --- [demo] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms

Expected behavior

The app starts and I can create my UI :)

Minimal reproducible example

https://github.com/salaboy/vaadin-demo

Versions

  • Vaadin / Flow version: <vaadin.version>24.7.6</vaadin.version>
  • Java version: openjdk version "21.0.5" 2024-10-15 LTS
  • OS version: Mac OSX 15.5
  • Browser version (if applicable): Safari / Chrome
  • Application Server (if applicable):
  • IDE (if applicable):

salaboy avatar Jun 09 '25 03:06 salaboy

The most likely cause is the spring-session-date-redis dependency, causing for some reason a sessionExpired message on the first UIDL request from Flow client. If you replace it with spring-data-redis the application starts.

Then there's another issue in ProductCatalogUI constructor: you are using field injection for productService but trying to use in the constructor, resulting in a NullPointerException. Using constructor injection would solve this problem.

And, looking at the posted logs, you might also have some issues with docker configuration, since it seems it is not running on your machine or the application is not properly configured (DOCKER_HOST tcp://127.0.0.1:53210 is not listening).

mcollovati avatar Jun 09 '25 05:06 mcollovati

@mcollovati, do you have any example with spring data redis somewhere that I can look at ?

  • Blog: http://salaboy.com http://salaboy.wordpress.com

  • Github user: http://github.com/salaboy

  • Twitter: http://twitter.com/salaboy

  • Mauricio "Salaboy" Salatino -

On Mon, 9 Jun 2025 at 13:27, Marco Collovati @.***> wrote:

mcollovati left a comment (vaadin/flow#21669) https://github.com/vaadin/flow/issues/21669#issuecomment-2954677490

The most likely cause is the spring-session-date-redis dependency, causing for some reason a sessionExpired message on the first UIDL request from Flow client. If you replace it with spring-data-redis the application starts.

Then there's another issue in ProductCatalogUI constructor: you are using field injection for productService but trying to use in the constructor, resulting in a NullPointerException. Using constructor injection would solve this problem.

— Reply to this email directly, view it on GitHub https://github.com/vaadin/flow/issues/21669#issuecomment-2954677490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACCMXSWPBIE3KD2J42VNN33CULMNAVCNFSM6AAAAAB634TVIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNJUGY3TONBZGA . You are receiving this because you authored the thread.Message ID: @.***>

salaboy avatar Jun 09 '25 06:06 salaboy

I'm sorry: nothing comes to my mind. But just replacing the dependencies org.springframework.session:spring-session-date-redis with org.springframework.data:spring-data-redis should be enough, and autoconfiguration should happen in the same way it does with the Spring Session Data Redis dependency.

mcollovati avatar Jun 09 '25 06:06 mcollovati

I will give that a try

  • Blog: http://salaboy.com http://salaboy.wordpress.com

  • Github user: http://github.com/salaboy

  • Twitter: http://twitter.com/salaboy

  • Mauricio "Salaboy" Salatino -

On Mon, 9 Jun 2025 at 14:16, Marco Collovati @.***> wrote:

mcollovati left a comment (vaadin/flow#21669) https://github.com/vaadin/flow/issues/21669#issuecomment-2954762992

I'm sorry: nothing comes to my mind. But just replacing the dependencies org.springframework.session:spring-session-date-redis with org.springframework.data:spring-data-redis should be enough, and autoconfiguration should happen in the same way it does with the Spring Session Data Redis dependency.

— Reply to this email directly, view it on GitHub https://github.com/vaadin/flow/issues/21669#issuecomment-2954762992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACCMXSLSCQTW5ONIIEDFEL3CURFHAVCNFSM6AAAAAB634TVIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNJUG43DEOJZGI . You are receiving this because you authored the thread.Message ID: @.***>

salaboy avatar Jun 09 '25 07:06 salaboy

@mcollovati after giving this a try again, I keep hitting issues with: "spring-session-data-redis". Spring Data Redis works as expected but there is definitely wrong with "spring-session-data-redis", Looking around it seems that this is a long standing issue. Trying to store the HTTP session for Vaadin applications seems to be an unresolved issue.

salaboy avatar Jun 14 '25 09:06 salaboy

References:

  • https://github.com/vaadin/framework/pull/9189
  • https://vaadin.com/forum/t/spring-boot-vaadin-flow-spring-session-redis-spring-security-sessi/157791
  • https://github.com/vaadin/spring/issues/340
  • https://github.com/vaadin/flow/issues/4746

salaboy avatar Jun 14 '25 09:06 salaboy

As you said, it is known that Spring Session is not playing well out-of-the-box with Vaadin because of how Spring Session works. Here are some additional details (maybe not up to date since the comment was from a couple of years ago) https://github.com/vaadin/kubernetes-kit/issues/4#issuecomment-1276004678

It might work with some configurations, but if PUSH is enabled, there will most likely be some issues.

mcollovati avatar Jun 14 '25 10:06 mcollovati

It will be very useful to get some idea of what configurations. I started thinking that maybe I can create a testing profile where I just test the endpoints to see if we remove vaadin from the equation that works.

  • Blog: http://salaboy.com http://salaboy.wordpress.com

  • Github user: http://github.com/salaboy

  • Twitter: http://twitter.com/salaboy

  • Mauricio "Salaboy" Salatino -

On Sat, 14 Jun 2025 at 19:45, Marco Collovati @.***> wrote:

mcollovati left a comment (vaadin/flow#21669) https://github.com/vaadin/flow/issues/21669#issuecomment-2972607714

As you said, it is known that Spring Session is not playing well out-of-the-box with Vaadin because of how Spring Session works. Here are some additional details (maybe not up to date since the comment was from a couple of years ago) vaadin/kubernetes-kit#4 (comment) https://github.com/vaadin/kubernetes-kit/issues/4#issuecomment-1276004678

It might work with some configurations, but if PUSH is enabled, there will most likely be some issues.

— Reply to this email directly, view it on GitHub https://github.com/vaadin/flow/issues/21669#issuecomment-2972607714, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACCMXRGWHQEMBYWWAMAWVD3DP4MPAVCNFSM6AAAAAB634TVIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNZSGYYDONZRGQ . You are receiving this because you authored the thread.Message ID: @.***>

salaboy avatar Jun 14 '25 11:06 salaboy

It will be very useful to get some idea of what configurations

It should basically be what is described in the linked Kubernets Kit issue comment. But I did not try it recently.

mcollovati avatar Jun 16 '25 05:06 mcollovati

It will be very useful to get some idea of what configurations

It should basically be what is described in the linked Kubernets Kit issue comment. But I did not try it recently.

Marco, can you link the comment that you are reffering too?

salaboy avatar Jun 16 '25 06:06 salaboy

https://github.com/vaadin/kubernetes-kit/issues/4#issuecomment-1276004678

mcollovati avatar Jun 16 '25 06:06 mcollovati

Looks like the same as this https://github.com/vaadin/flow/issues/4746.

mshabarov avatar Jun 17 '25 10:06 mshabarov