vaadin4spring icon indicating copy to clipboard operation
vaadin4spring copied to clipboard

Reconfigure the UI beans after deserialization

Open peholmst opened this issue 10 years ago • 13 comments

Currently, a Spring4Vaadin UI cannot be serialized, which is problematic for cluster deployments. This should be fixed by ensuring that:

  • Spring4Vaadin itself is properly serializable, and
  • the UI beans are reconfigured after deserialization, so that e.g. transient backend references are re-injected.

peholmst avatar Feb 03 '15 08:02 peholmst

Any idea how we can automatically test this?

peholmst avatar Feb 03 '15 08:02 peholmst

This task might be transferred to the official add-on team once the first version of the Vaadin official Spring add-on is released.

peholmst avatar Feb 19 '15 11:02 peholmst

hi Petter is there an approximate timeline for the official add-on release

FearlessHyena avatar Feb 19 '15 15:02 FearlessHyena

I think the beta will be released in a few weeks, but it will not include support for serializable sessions.

peholmst avatar Feb 19 '15 15:02 peholmst

http://stackoverflow.com/questions/34400416/enableredishttpsession-fails-with-vaadin

Am I having the problem described here?

Can I do something about it?

khauser avatar Dec 21 '15 16:12 khauser

Yes, that's the problem, and it is deep inside Vaadin Spring so there is no easy way of fixing it.

peholmst avatar Dec 21 '15 17:12 peholmst

I debugged myself a little bit into this and updated the question at stackoverflow. For me it has something to to with wrong serialization ids.

khauser avatar Dec 22 '15 10:12 khauser

Indeed I had a preliminary bug/failure. But after "fixing" it I run into this Caused by: java.io.NotSerializableException: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext exception (with this SpringUIProviders in it).

In a comment in http://stackoverflow.com/questions/29388542/notserializableexception-on-serialization-of-objects-currently-shown-by-vaadin @chelu talks also about "reconfigured/re-populated UI components after deserialization" more or less like you did above. He had setup his own spring vaadin connection (and a lot more) in his project jdal. Could you have a look into that? Maybe it's helpful, there are also some sample integrations.

khauser avatar Dec 28 '15 10:12 khauser

Could you please add that information to this ticket as well? https://dev.vaadin.com/ticket/18164

I doubt I will be able to fix this in Vaadin4Spring, it needs to be addressed in the official add-on.

peholmst avatar Dec 28 '15 10:12 peholmst

Okay I will. Thank you!

khauser avatar Dec 28 '15 10:12 khauser

+1. I'm evaluating vaadin whether it can work in clustering environment. I‘m aslo look forward to this bug be fixed soon.

LaiZhou avatar Jul 12 '16 13:07 LaiZhou

You might have a look here: https://github.com/khauser/microservices4vaadin (within the frontend service) There I used a SerializableProxy from jdal's library. Together with some other fixes (check out https://github.com/vaadin/spring/pull/32) to the vaadin's spring integration it all seems to work.

khauser avatar Jul 21 '16 16:07 khauser

Wanted to check. Is this issue fixed via the other referenced issue fixes?

FearlessHyena avatar Mar 11 '17 17:03 FearlessHyena