Flow + Spring Session + Hazelcast

Hello,

I’m trying to configure a Vaadin Flow spring-boot application to use HttpSession replication using Hazelcast but has not been successful so far.

I have a simple test project consisting of two files:
I am using Kotlin on Vaadin btw.

Bootstrap.Kt

@SpringBootApplication
@EnableHazelcastHttpSession
open class Bootstrap {

    companion object {
        @JvmStatic fun main(args: Array<String>) {
            SpringApplication.run(Bootstrap::class.java, *args)
        }
    }

    @Bean
    open fun hazelcastInstance() : HazelcastInstance {
        val config = Config()
        val joinConfig = config.networkConfig.join
        joinConfig.multicastConfig.isEnabled=false
        joinConfig.tcpIpConfig.setEnabled(true).members = arrayListOf("127.7.0.1")
        return Hazelcast.newHazelcastInstance(config)
    }
	
// Another configuration but same error when clicking the button.	
//    @Bean
//    open fun hazelcastInstance() : HazelcastInstance {
//        val attributeConfig = MapAttributeConfig()
//                .setName(HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
//                .setExtractor(PrincipalNameExtractor::class.java.name)
//        val config = Config()
//        config.getMapConfig(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME)
//                .addMapAttributeConfig(attributeConfig)
//                .addMapIndexConfig(MapIndexConfig(
//                        HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false))
//        return Hazelcast.newHazelcastInstance(config)
//    }

}

And a simple View, MainView.Kt

@Route("")
class MainView : VerticalLayout() {
    init {
        h3 {
            text = "Allo again! 3"
        }
        val textInput = TextField()
        val button = Button("Click me!")
        button.addClickListener {
            textInput.value += "m-"
        }
        add(textInput, button)
    }
}

My build.gradle:

plugins {
    id "org.jetbrains.kotlin.jvm" version "1.2.70"
    id "io.spring.dependency-management" version "1.0.6.RELEASE"
    id "org.springframework.boot" version "2.0.5.RELEASE"
    id "com.devsoap.vaadin-flow" version "1.0.0.M5"
}
repositories {
    jcenter()
    mavenCentral()
    vaadin.repositories()
    maven { url "https://dl.bintray.com/mvysny/github" }
}
vaadin {
    version '10.0.4'
}
dependencies {
    implementation vaadin.bom()
    implementation vaadin.platform()

    implementation "org.jetbrains.kotlin:kotlin-stdlib"
    implementation "org.jetbrains.kotlin:kotlin-reflect"
    implementation "com.github.vok.karibudsl:karibu-dsl-v10:0.4.9"

    implementation("com.vaadin:vaadin-spring-boot-starter")
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation("org.springframework.session:spring-session-hazelcast:2.0.6.RELEASE")
    compileOnly("org.springframework.boot:spring-boot-devtools")
}
springBoot {
    mainClassName = 'root.Bootstrap'
}

I run the application as a Spring Boot jar. The app starts fine, The embdded Hazelcast servers start. The web filter are loaded. I can display the MainView in the browser (chrome and firefox).


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.5.RELEASE)

2018-09-18 22:53:48.912  INFO 11052 --- [           main]
 root.Bootstrap$Companion                 : Starting Bootstrap.Companion on ubuntu with PID 11052 (/home/user/springtest/build/classes/kotlin/main started by ren in /home/ren/springtest)
2018-09-18 22:53:48.918  INFO 11052 --- [           main]
 root.Bootstrap$Companion                 : No active profile set, falling back to default profiles: default
2018-09-18 22:53:49.054  INFO 11052 --- [           main]
 ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@19d37183: startup date [Tue Sep 18 22:53:49 EDT 2018]
; root of context hierarchy
2018-09-18 22:53:49.289  WARN 11052 --- [kground-preinit]
 o.s.h.c.j.Jackson2ObjectMapperBuilder    : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
2018-09-18 22:53:49.736  INFO 11052 --- [           main]
 o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'dispatcherServletRegistration' with a different definition: replacing [Root bean: class [null]
; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration; factoryMethodName=dispatcherServletRegistration; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration.class]
] with [Root bean: class [null]
; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=com.vaadin.flow.spring.DispatcherServletRegistrationBeanConfig; factoryMethodName=dispatcherServletRegistration; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/vaadin/flow/spring/DispatcherServletRegistrationBeanConfig.class]
]
2018-09-18 22:53:50.735  INFO 11052 --- [           main]
 o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-09-18 22:53:50.772  INFO 11052 --- [           main]
 o.apache.catalina.core.StandardService   : Starting service [Tomcat]

2018-09-18 22:53:50.772  INFO 11052 --- [           main]
 org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.34
2018-09-18 22:53:50.785  INFO 11052 --- [ost-startStop-1]
 o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: 
[/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2018-09-18 22:53:50.983  INFO 11052 --- [ost-startStop-1]
 o.a.c.c.C.[Tomcat]
.[localhost]
.
[/]       : Initializing Spring embedded WebApplicationContext
2018-09-18 22:53:50.984  INFO 11052 --- [ost-startStop-1]
 o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1935 ms
2018-09-18 22:53:51.659  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.instance.AddressPicker     : [LOCAL]
 [dev]
 [3.9.4]
 Interfaces is disabled, trying to pick one address from TCP-IP config addresses: [127.0.0.1]

2018-09-18 22:53:51.666  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.instance.AddressPicker     : [LOCAL]
 [dev]
 [3.9.4]
 Picked [127.0.0.1]
:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701]
, bind any local is true
2018-09-18 22:53:51.681  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.system                     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Hazelcast 3.9.4 (20180420 - b8001d5) starting at [127.0.0.1]
:5701
2018-09-18 22:53:51.681  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.system                     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
2018-09-18 22:53:51.681  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.system                     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Configured Hazelcast Serialization version: 1
2018-09-18 22:53:51.931  INFO 11052 --- [ost-startStop-1]
 c.h.s.i.o.impl.BackpressureRegulator     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Backpressure is disabled
2018-09-18 22:53:52.492  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.instance.Node              : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Creating TcpIpJoiner
2018-09-18 22:53:52.666  INFO 11052 --- [ost-startStop-1]
 c.h.s.i.o.impl.OperationExecutorImpl     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Starting 8 partition threads and 5 generic threads (1 dedicated for priority tasks)
2018-09-18 22:53:52.670  INFO 11052 --- [ost-startStop-1]
 c.h.internal.diagnostics.Diagnostics     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
2018-09-18 22:53:52.677  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.core.LifecycleService      : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 [127.0.0.1]
:5701 is STARTING
2018-09-18 22:53:52.706  INFO 11052 --- [cached.thread-2]
 com.hazelcast.nio.tcp.TcpIpConnector     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Connecting to /127.0.0.1:5702, timeout: 0, bind-any: true
2018-09-18 22:53:52.706  INFO 11052 --- [cached.thread-3]
 com.hazelcast.nio.tcp.TcpIpConnector     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Connecting to /127.0.0.1:5703, timeout: 0, bind-any: true
2018-09-18 22:53:52.707  INFO 11052 --- [cached.thread-2]
 com.hazelcast.nio.tcp.TcpIpConnector     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Could not connect to: /127.0.0.1:5702. Reason: SocketException[Connection refused to address /127.0.0.1:5702]

2018-09-18 22:53:52.707  INFO 11052 --- [cached.thread-3]
 com.hazelcast.nio.tcp.TcpIpConnector     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Could not connect to: /127.0.0.1:5703. Reason: SocketException[Connection refused to address /127.0.0.1:5703]

2018-09-18 22:53:52.707  INFO 11052 --- [cached.thread-2]
 com.hazelcast.cluster.impl.TcpIpJoiner   : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 [127.0.0.1]
:5702 is added to the blacklist.
2018-09-18 22:53:52.707  INFO 11052 --- [cached.thread-3]
 com.hazelcast.cluster.impl.TcpIpJoiner   : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 [127.0.0.1]
:5703 is added to the blacklist.
2018-09-18 22:53:53.703  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.system                     : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 Cluster version set to 3.9
2018-09-18 22:53:53.704  INFO 11052 --- [ost-startStop-1]
 c.h.internal.cluster.ClusterService      : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 

Members {size:1, ver:1} [
	Member [127.0.0.1]
:5701 - f6c55f85-6ec4-4774-9533-a7f9c36553ea this
]

2018-09-18 22:53:53.732  INFO 11052 --- [ost-startStop-1]
 com.hazelcast.core.LifecycleService      : [127.0.0.1]
:5701 [dev]
 [3.9.4]
 [127.0.0.1]
:5701 is STARTED
2018-09-18 22:53:53.922  INFO 11052 --- [ost-startStop-1]
 o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: 
[/*]
2018-09-18 22:53:53.922  INFO 11052 --- [ost-startStop-1]
 o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'sessionRepositoryFilter' to: 
[/*]
2018-09-18 22:53:53.923  INFO 11052 --- [ost-startStop-1]
 o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: 
[/*]
2018-09-18 22:53:53.923  INFO 11052 --- [ost-startStop-1]
 o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: 
[/*]
2018-09-18 22:53:53.923  INFO 11052 --- [ost-startStop-1]
 o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: 
[/*]
2018-09-18 22:53:53.923  INFO 11052 --- [ost-startStop-1]
 o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcher mapped to 
[/*]
2018-09-18 22:53:53.925  INFO 11052 --- [ost-startStop-1]
 o.s.b.w.servlet.ServletRegistrationBean  : Servlet springServlet mapped to 
[/vaadinServlet/*]
2018-09-18 22:53:54.180  INFO 11052 --- [           main]
 o.s.w.s.handler.SimpleUrlHandlerMapping  : Default mapping to handler of type [class org.springframework.web.servlet.mvc.ServletForwardingController]

2018-09-18 22:53:54.209  INFO 11052 --- [           main]
 o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path 
[/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

2018-09-18 22:53:54.393  INFO 11052 --- [           main]
 s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@19d37183: startup date [Tue Sep 18 22:53:49 EDT 2018]
; root of context hierarchy
2018-09-18 22:53:54.473  INFO 11052 --- [           main]
 s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{
[/error],produces=[text/html]
}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-09-18 22:53:54.474  INFO 11052 --- [           main]
 s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{
[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-09-18 22:53:54.515  INFO 11052 --- [           main]
 o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path 
[/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

2018-09-18 22:53:54.515  INFO 11052 --- [           main]
 o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path 
[/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]

2018-09-18 22:53:54.769  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereHandler com.vaadin.flow.server.communication.PushAtmosphereHandler mapped to context-path: /*
2018-09-18 22:53:54.769  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.flow.server.communication.PushAtmosphereHandler
2018-09-18 22:53:54.798  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Atmosphere is using org.atmosphere.util.VoidAnnotationProcessor for processing annotation
2018-09-18 22:53:54.809  INFO 11052 --- [           main]
 org.atmosphere.util.ForkJoinPool         : Using ForkJoinPool  java.util.concurrent.ForkJoinPool. Set the org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads to -1 to fully use its power.
2018-09-18 22:53:54.814  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
2018-09-18 22:53:54.821  INFO 11052 --- [           main]
 o.a.container.JSR356AsyncSupport         : JSR 356 Mapping path /vaadinServlet
2018-09-18 22:53:54.837  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installing Default AtmosphereInterceptors
2018-09-18 22:53:54.838  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
2018-09-18 22:53:54.838  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
2018-09-18 22:53:54.839  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
2018-09-18 22:53:54.839  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
2018-09-18 22:53:54.839  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Dropping Interceptor org.atmosphere.interceptor.HeartbeatInterceptor
2018-09-18 22:53:54.840  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
2018-09-18 22:53:54.840  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
2018-09-18 22:53:54.842  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
2018-09-18 22:53:54.842  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
2018-09-18 22:53:54.842  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
2018-09-18 22:53:54.843  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : 	org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
2018-09-18 22:53:54.843  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
2018-09-18 22:53:54.843  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor CORS Interceptor Support with priority FIRST_BEFORE_DEFAULT 
2018-09-18 22:53:54.848  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Default Response's Headers Interceptor with priority AFTER_DEFAULT 
2018-09-18 22:53:54.849  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Browser Padding Interceptor Support with priority AFTER_DEFAULT 
2018-09-18 22:53:54.849  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Android Interceptor Support with priority AFTER_DEFAULT 
2018-09-18 22:53:54.849  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor SSE Interceptor Support with priority AFTER_DEFAULT 
2018-09-18 22:53:54.849  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor JSONP Interceptor Support with priority AFTER_DEFAULT 
2018-09-18 22:53:54.849  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Atmosphere JavaScript Protocol with priority AFTER_DEFAULT 
2018-09-18 22:53:54.849  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor with priority AFTER_DEFAULT 
2018-09-18 22:53:54.850  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor Browser disconnection detection with priority AFTER_DEFAULT 
2018-09-18 22:53:54.850  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Installed AtmosphereInterceptor org.atmosphere.interceptor.IdleResourceInterceptor with priority BEFORE_DEFAULT 
2018-09-18 22:53:54.850  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Using EndpointMapper class org.atmosphere.util.DefaultEndpointMapper
2018-09-18 22:53:54.850  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
2018-09-18 22:53:54.850  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
2018-09-18 22:53:54.850  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Broadcaster Shared List Resources: false
2018-09-18 22:53:54.851  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Broadcaster Polling Wait Time 100
2018-09-18 22:53:54.851  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Shared ExecutorService supported: true
2018-09-18 22:53:54.851  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Messaging ExecutorService Pool Size unavailable - Not instance of ThreadPoolExecutor
2018-09-18 22:53:54.851  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Async I/O Thread Pool Size: 200
2018-09-18 22:53:54.851  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
2018-09-18 22:53:54.851  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Using AtmosphereResurceFactory: org.atmosphere.cpr.DefaultAtmosphereResourceFactory
2018-09-18 22:53:54.851  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
2018-09-18 22:53:54.856  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Invoke AtmosphereInterceptor on WebSocket message true
2018-09-18 22:53:54.856  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : HttpSession supported: true
2018-09-18 22:53:54.856  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Atmosphere is using DefaultAtmosphereObjectFactory for dependency injection and object creation
2018-09-18 22:53:54.856  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Atmosphere is using async support: org.atmosphere.container.JSR356AsyncSupport running under container: Apache Tomcat/8.5.34 using javax.servlet/3.0 and jsr356/WebSocket API
2018-09-18 22:53:54.856  INFO 11052 --- [           main]
 org.atmosphere.cpr.AtmosphereFramework   : Atmosphere Framework 2.4.24.vaadin1 started.
2018-09-18 22:53:54.859  INFO 11052 --- [           main]
 o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-09-18 22:53:54.889  INFO 11052 --- [           main]
 o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2018-09-18 22:53:54.895  INFO 11052 --- [           main]
 root.Bootstrap$Companion                 : Started Bootstrap.Companion in 6.463 seconds (JVM running for 7.15)

As soon as I hit the button, I get the following error on the server:

java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected sync id: 0, got 1. Message start: {"csrfToken":"6482e8eb-c5f3-4327-aca0-1898afded43f","rpc":[{"type":"event","node":4,"event":"click","data":{"event.shiftKey":false,"event.metaKey":false,"event.detail":1,"event.ctrlKey":false,"event.clientX":80,"event.clientY":146,"event.altKey":false,"event.button":0,"event.screenY":298,"event.screenX":147}}]
,"syncId":1,"clientId":1}
	at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:302) ~[flow-server-1.0.5.jar:na]

	at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:89) ~[flow-server-1.0.5.jar:na]

	at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[flow-server-1.0.5.jar:na]

	at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1486) ~[flow-server-1.0.5.jar:na]

	at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:300) [flow-server-1.0.5.jar:na]

	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:356) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141) [spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177) [spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:52) [spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) [spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) [spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) [spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877) [spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [javax.servlet-api-3.1.0.jar:3.1.0]

	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) [spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) [spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:147) [spring-session-core-2.0.6.RELEASE.jar:2.0.6.RELEASE]

	at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:81) [spring-session-core-2.0.6.RELEASE.jar:2.0.6.RELEASE]

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181]

	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.34.jar:8.5.34]

	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]

Any idea why I’m getting this error? Am I missing configuration?
Or is it even doable with Vaadin Flow.

There is this Vaadin blog talking about it: [https://vaadin.com/microservices/learn/high-availability]
(https://vaadin.com/microservices/learn/high-availability)

Also, another strange behavior - if I hit the browser refresh button after having clicked the button and got the error, the page keeps reloading endlessly.

Thanks for your help!

J.

Note: I am getting the same behavior as this one: [Spring session (REDIS)]
(https://vaadin.com/forum/thread/17277282/17277283)

Hello Jérôme Médin,
did you progressed in this matter? I ran into the same problem and now I’m looking for a solution too.