java - NotSerializableException on serialization of objects currently shown by Vaadin -
i notserializableexception when want serialize object shown vaadin.
the structure this:
vaadin ui <--- serialize / deserialize --- > hibernate/jpa postgres database
vaadin shows objects requested database via ipc, when manipulate object , want save again serializing , sending on controller 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 serializer want annotationconfigembeddedwebapplicationcontext , there workaround? can remove beforehand?
spring components not serializable (or should not serialized @ all).
injecting spring components in vaadin components linked vaadin ui tricky because them should declared transient
, re-populated after deserialization..
i wrote small library jdal-aop ease process, using spring-aop serializable proxies.
for example
public class mainlayout extends verticallayout { @autowired @serializableproxy // make dao serializable private customerdao customerdao; }
it useful you.
Comments
Post a Comment