The problem is likely that you are trying to write a JuMPArray of variables, each of which have a reference to the model, which has a pointer to the solver.
Why are you trying to do this?
It is probably better to save the data needed to build the model, rather than the model itself.