Guide
Diagnosing Vaadin Push Issues: From Missing Annotation to WebSocket Fallback
Learn how to diagnose Vaadin Push problems, from missing annotations to WebSocket fallbacks, with step‑by‑step checks and fixes.
Published by Tasadduq Burney
31 Dec 2025, 11:52 UTC
3 min127K views0

Recognizable Condition
When Vaadin Push is enabled but the UI does not receive server‑initiated updates, the client may fall back to long‑polling, show delayed updates, or display no change at all.
Cause / Diagnostic Table
| Possible Cause | Symptom |
|---|---|
| @Push missing or on wrong class | No WebSocket upgrade request; console shows polling requests. |
| vaadin‑push dependency absent | Application starts but Push annotation is ignored; same polling behavior. |
| Servlet container lacks WebSocket support (e.g., Tomcat 8) | Framework logs fallback to long‑polling; ws:// handshake fails. |
| Browser does not support WebSocket (old IE) | Client uses XHR polling; increased network traffic. |
| Push message exceeds default 2 KB limit | Message fragmented or dropped; UI update missing or partial. |
| Non‑serializable UI component state | On reconnection, serialization exception in server logs; UI may reset. |
Ordered Checks
- Verify the UI class annotation
- Open the UI subclass source.
- Confirm it is annotated with
@Push(or@Push(PushMode.AUTOMATIC)). - Ensure the class extends
com.vaadin.ui.UI(Vaadin 8) orcom.vaadin.flow.component.UI(Flow).
- Check Maven/Gradle dependency
- Look for
vaadin-pushinpom.xmlorbuild.gradle. - Version should match the Vaadin core version (e.g.,
23.0.0).
- Look for
- Confirm servlet container WebSocket support
- For Tomcat, ensure version 9.0+; for Jetty, 9.4+.
- Check that the
websocketmodule orServletContainerInitializeris present (no extra config needed for embedded servers).
- Inspect browser console for WebSocket handshake
- Open developer tools → Network → WS (or look for
ws://orwss://requests). - Successful handshake shows status 101 Switching Protocols.
- If only polling (
GET ...?v-uiId) appears, WebSocket upgrade failed.
- Open developer tools → Network → WS (or look for
- Test a manual push
- Add a temporary button that calls
UI.getCurrent().access(() -> UI.getCurrent().push());or useUI.getPage().push()from a background thread. - Observe whether the client updates without a full reload.
- Add a temporary button that calls
- Check push message size
- If you send large objects (e.g., big collections), enable Vaadin debug mode to see warnings about message size.
- Consider splitting data or using
setDataon components.
- Verify component state serializability
- Look for
java.io.NotSerializableExceptionin server logs after a reconnection. - Mark non‑serializable fields as
transientor make them implementSerializable.
- Look for
Fixes Tied to Findings
- Missing
@Push→ add the annotation to the UI subclass. - Missing dependency → add
<dependency><groupId>com.vaadin</groupId><artifactId>vaadin-push</artifactId><version>${vaadin.version}</version></dependency>(Maven) or equivalent Gradle. - Unsupported container → upgrade to Tomcat 9+ or Jetty 9.4+, or enable WebSocket support via container‑specific configuration.
- Browser lack of WebSocket → inform users to use a modern browser; the framework will automatically fall back to polling, accepting higher latency.
- Message size > 2 KB → split updates, use
push()with smaller payloads, or increase the buffer viavaadin.push.websocket.maxMessageSizeif the container allows. - Non‑serializable state → make fields transient or implement
Serializable; review custom components for proper serialization.
Escalation Criteria
If after performing all checks the UI still does not receive updates:
- Enable Vaadin debug mode (
vaadin.debug=true) and examine the console for detailed Push‑related logs. - Capture a network trace (e.g., using Chrome DevTools) to confirm whether any WebSocket frames are being sent from server to client.
- Review server‑side logs for exceptions during
PushHandlerprocessing. - If the problem persists, consider opening a Vaadin ticket with the gathered logs, dependency tree, and container version.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.