-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload component holds reference to UI element and cause serialization exception when tomcat reloaded during development mode #14893
Comments
Added stack trace
|
The reference chain looks like below;
This args have some references to UI as well as other fields which may have non-serializable fields |
Minimal reproducible exampleJust make a change in the file and trigger auto reload It will cause
|
Most likely this is because the UIs are left out of session serialization by default in development mode but the stream resources are not. For session serialization to work, all UIs and stream resources need to be serializable. However, to fix this issue, we should probably exclude stream resources also from serialization in dev mode, when the flag is not turned on |
Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893
Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893
Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893
Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893
Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893
Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893 Co-authored-by: caalador <[email protected]>
Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893 Co-authored-by: caalador <[email protected]>
* fix: no stream serialization without uis (#15287) Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893 * Fix test Co-authored-by: caalador <[email protected]>
This ticket/PR has been released with Vaadin 23.2.11. |
This ticket/PR has been released with Vaadin 24.0.0.alpha6 and is also targeting the upcoming stable 24.0.0 version. |
Do not serialize the streamResourceRegistry if UIs are not serialized. Fixes #14893
Description of the bug
This is 100% reproducible and debugable
If you use Upload component and lets say use a non-serializable reference like (crudrepository ) in
ComponentEventListener<SucceededEvent>
, when you make change and live-reload triggers, the tomcat tries persist the session.During serialization process,
VaddinSession
gets serialized with reference toComponentEventListener
which has a reference to its UI/Route component as well as this non-serializable frield (CrudRepositroy) which causesjava.io.NotSerializableException
My Route definition looks like below
Expected behavior
Application show reload without and exception log
Minimal reproducible example
Versions
Vaadin: 23.3.0.alpha1
Flow: 23.3.0.alpha1
Java: Oracle Corporation 17.0.1
OS: amd64 Windows 10 10.0
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Live reload: Java active (Spring Boot Devtools): Front end unavailable
The text was updated successfully, but these errors were encountered: