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.

Upload component holds reference to UI element and cause serialization exception when tomcat reloaded during development mode

See original GitHub issue

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 to ComponentEventListener which has a reference to its UI/Route component as well as this non-serializable frield (CrudRepositroy) which causes java.io.NotSerializableException

image

My Route definition looks like below

image

Expected behavior

Application show reload without and exception log

Minimal reproducible example

  1. Include a Upload component in a Route and also add SucceededEvent Listener
  2. Use Springs Data Jdbc Crud repository (or maybe any non-serialzable reference)
  3. Navigate the this route
  4. Make change and trigger auto-reload
  5. You will see long stack trace of exception about serialization on some Jdbc reference

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

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Artur-commented, Oct 25, 2022

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

0reactions
vaadin-botcommented, Dec 14, 2022

This ticket/PR has been released with Vaadin 24.0.0.alpha6 and is also targeting the upcoming stable 24.0.0 version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Tomcat reload features to speed up development
On an Apache Tomcat server, to "reload" an application means to call a method of the StandardContext class called StandardContext.reload() on a given...
Read more >
Apache Tomcat 8 Configuration Reference (8.5.84)
Serializable interface. You MAY cause the Manager to enforce this restriction by including the <distributable> element in your web application ...
Read more >
“How-to” Guides - Spring
Then the Spring Boot banner is not printed on startup, and the application is not starting an embedded web server. Properties defined in...
Read more >
[GWT] Documentation - Compile & Debug
If your GWT application runs in development mode as you expect… and the GWT compiler successfully compiles your application into JavaScript… then your ......
Read more >
Building your WebGL application - Unity - Manual
Build and Run builds your application in a Player, and opens that Player on your target platform. Build Settings Window. The Unity build...
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