tried to move from states terminated to terminated which is not allowed

Ater updating my page I got the following error message :> “tied to move from states terminated to terminated which is not allowed” followed by message “Invalid JSON from server for(;;);[{“syncId”:1487,“clientId”:1,“meta”:{“async”:true},“timings”:[12746,0]
}]for(;;);[{“syncId”:1488,“clientId”:1,“meta”:{“async”:true},“timings”:[12746,0]
}]”

I only get this error on my deployed vaadin client, I do not have it in my development environment.
By observing the logs I have no error neither on my client nor on my server. Yet my client seems stuck with this error.
he is constantly repeating the same request : “https://myClientVaadin.com/VaadinServlet/?v-r=push&v-uiId=12&v-pushId=78b26f39-290a-4f14-9c94-71e8c04bdd1a&X-Atmosphere-tracking-id=db497b84-0b7c-477a-aefa-875d21566a08&X-Atmosphere-Framework=2.3.2.vaadin1-javascript&X-Atmosphere-Transport=long-polling&Content-Type=application%2Fjson%3B%20charset%3DUTF-8&X-atmo-protocol=true&_=1531732933750”. it’s a 501 error type websocket

I get this error only if my user refreshes the page when he is logged in.
It is connected via a server that uses spring security and uses the session and cookie to retrieve its information. I thought it could be related to the information that is in session but as it works in development I do not believe it too much.
Do you have an idea of what may be causing this problem?

I had the same problem but then I was able to solve it.

In my project, I run Vaadin on an embedded Jetty server. Jetty adds WebSocket support via a ServletContainerInitializer, which is a Service Provider Interface (SPI) from the Servlet spec. Thus, the directory META-INF/services must contain a file called javax.servlet.ServletContainerInitializer which lists all classes implementing that interface. This is the case for the Jetty WebSocket module, so everything should work fine.

However, the problem arises during Maven build if you have multiple dependencies that provide implementations of the interface, since all of them contain a file of the same name in META-INF/services. In my case, this is how support for WebSockets was gone after the build.

I use the maven-shade-plugin to produce a jar file, and after some investigation I found that they already provide a solution to this problem. Namely, you have to tell it to use a ServicesResourceTransformer, which merges SPI files of the same name instead of overriding them (see [https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#ServicesResourceTransformer]
(https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#ServicesResourceTransformer)). So your pom.xml should look similar to this:

...
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-shade-plugin</artifactId>
      <version>3.2.0</version>
      <configuration>
        <transformers>
          <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
        </transformers>
        <!-- Other configuration -->
      </configuration>
    <plugin>
  </plugins>
</build>
...