question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DebugWindowConnection check causes problems on Liberty websockets

See original GitHub issue

Description of the bug

Open OpenLiberty 22 (and 19) you get

[err] [Atmosphere-Shared-2] ERROR com.vaadin.flow.server.communication.PushAtmosphereHandler - Exception in push connection
[err] java.lang.IllegalStateException: Request object no longer valid. This object has been cancelled
[err]   at org.atmosphere.cpr.AtmosphereResourceImpl.getRequest(AtmosphereResourceImpl.java:422)
[err]   at org.atmosphere.cpr.AtmosphereResourceImpl.getRequest(AtmosphereResourceImpl.java:436)
[err]   at com.vaadin.flow.server.communication.PushHandler.isDebugWindowConnection(PushHandler.java:606)
[err]   at com.vaadin.flow.server.communication.PushHandler.handleConnectionLost(PushHandler.java:360)
[err]   at com.vaadin.flow.server.communication.PushHandler.connectionLost(PushHandler.java:333)
[err]   at com.vaadin.flow.server.communication.PushAtmosphereHandler$AtmosphereResourceListener.onDisconnect(PushAtmosphereHandler.java:113)
[err]   at org.atmosphere.cpr.AtmosphereResourceImpl.onDisconnect(AtmosphereResourceImpl.java:759)
[err]   at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:650)
[err]   at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:630)
[err]   at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:897)
[err]   at org.atmosphere.cpr.DefaultBroadcaster$2.run(DefaultBroadcaster.java:474)
[err]   at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

Looks like it does not allow checking attributes from the request when it has been closed.

Expected behavior

No exception when a websocket connection is lost.

Minimal reproducible example

https://github.com/vesanieminen/sample-mpr-v14/tree/v23

Versions

  • Vaadin / Flow version: 23.0.4

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
Artur-commented, Jun 20, 2022

You are including Tomcat in the WAR which will cause Atmosphere to use Tomcat classes instead of Liberty. If you add

    <exclusion>
            <artifactId>tomcat-embed-el</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
    </exclusion>
    <exclusion>
            <artifactId>tomcat-embed-core</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
    </exclusion>
    <exclusion>
            <artifactId>tomcat-embed-websocket</artifactId>
            <groupId>org.apache.tomcat.embed</groupId>
    </exclusion>

to the spring boot starter dependency, it works as expected

1reaction
mshabarovcommented, May 12, 2022

Eventually caught the error with Open Liberty 22 bundle:

[err] [ForkJoinPool.commonPool-worker-5] INFO com.vaadin.base.devserver.AbstractDevServerRunner - Started Webpack. Time: 5897ms
[err] [dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker - No issues found.
[WARNING ] Exception during suspend() operation java.lang.IllegalStateException: Request object no longer valid. This object has been cancelled
[err] [Atmosphere-Shared-1] ERROR com.vaadin.flow.server.communication.PushAtmosphereHandler - Exception in push connection
[err] java.lang.IllegalStateException: Request object no longer valid. This object has been cancelled
[err] 	at org.atmosphere.cpr.AtmosphereResourceImpl.getRequest(AtmosphereResourceImpl.java:422)
[err] 	at org.atmosphere.cpr.AtmosphereResourceImpl.getRequest(AtmosphereResourceImpl.java:436)
[err] 	at com.vaadin.flow.server.communication.PushHandler.isDebugWindowConnection(PushHandler.java:606)
[err] 	at com.vaadin.flow.server.communication.PushHandler.handleConnectionLost(PushHandler.java:360)
[err] 	at com.vaadin.flow.server.communication.PushHandler.connectionLost(PushHandler.java:333)
[err] 	at com.vaadin.flow.server.communication.PushAtmosphereHandler$AtmosphereResourceListener.onDisconnect(PushAtmosphereHandler.java:113)
[err] 	at org.atmosphere.cpr.AtmosphereResourceImpl.onDisconnect(AtmosphereResourceImpl.java:759)
[err] 	at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:650)
[err] 	at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:630)
[err] 	at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:897)
[err] 	at org.atmosphere.cpr.DefaultBroadcaster$2.run(DefaultBroadcaster.java:474)
[err] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[err] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[err] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[err] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[err] 	at java.base/java.lang.Thread.run(Thread.java:834)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Liberty collective troubleshooting - IBM
Cause : The servers might not be running. Verify that the collective controller and member servers are running. If the servers are running,...
Read more >
WebSphere liberty web socket lost messages - Stack Overflow
I'm playing with web sockets on WebSphere Liberty 16.0.0.3 and seeing something odd. If I send a number of messages back to back...
Read more >
Java WebSocket 1.1 :: Open Liberty Docs
2.0. 1.1. 1.0. This feature enables support for WebSocket applications written to the Java API for WebSocket 1.1 specification.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found