How do I prevent a field from serialization in a PersistentStateComponent?


I have a     

private volatile ScheduledFuture<?> timerFuture;

in my implementation of PersistentStateComponent and it is saving it out to the xml, but then it can't read it in.  I don't need it saved though and if I could stop that, then it would load fine (as it loads fine if I remove timerFuture).  I tried:

private transient volatile ScheduledFuture<?> timerFuture;

But that did not prevent it.  Is there a way?


Hi Karol Lewandowski ,

I actually tried that, but it seems to have no effect.

I still end up with this in the xml:
    <option name="timerFuture">
     <ScheduledFuture />


It was lombok @Gettter/@Setter on the class instead of the 3 fields I care about.

This line is what helped me figure it out:


Please sign in to leave a comment.