I get a NotSerializableException when I want to serialize an Object that is currently shown by Vaadin.
The structure is like this:
Vaadin UI <--- serialize / deserialize --- > Hibernate/JPA Postgres Database
Vaadin shows objects that are requested from the Database via IPC, but when I manipulate the object and want to save it again by serializing it and sending it over to the controller I get the following Exception:
java.io.NotSerializableException: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
at java.util.LinkedList.writeObject(LinkedList.java:1118)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
I tried to:
Request -> manipulate -> Save | works
Request -> show in Vaadin -> manipulate in Vaadin-> Save | doesn't work
Why does the Serializer want to AnnotationConfigEmbeddedWebApplicationContext and is there a workaround? Can I remove it beforehand?