NotSerializableException on SimpleListProperty

后端 未结 6 1884
予麋鹿
予麋鹿 2020-12-10 08:09

I\'m using Javafx, and I wrap my objects into ListProperty to let the tableview updates for any changes on the objects of the list. Now I\'m trying to serialize my project a

6条回答
  •  囚心锁ツ
    2020-12-10 08:44

    I had the same Problem: my solution.

    was using the interface Externalizable and write my own writeExternal and readExternal Method.

    Later i've used XStream an had a problem with Externalizable. The quick fix was changing the priority of ExternalizableConverter with the code below.

        xstream.registerConverter(new ReflectionConverter(xstream.getMapper(),
                xstream.getReflectionProvider()) {
            public boolean canConvert(Class type) {
                return Externalizable.class.isAssignableFrom(type);
            }
        }, XStream.PRIORITY_LOW);
    

提交回复
热议问题