Hello i am developing a web application using java faces .. i know a terrible choice anyways i am receiving this error :
java.io.InvalidClassException - core.entities.PrimaryUser; local class incompatible: stream classdesc serialVersionUID = -3071143254300957400, local class serialVersionU开发者_StackOverflow中文版ID = 1
would you please help or guide me ... thanks alot
It looks like you've serialized an old version of PrimaryUser
, and now you're trying to load that data back again, having changed the class. That won't work, in general. Binary serialization in Java is extremely tricky when it comes to backward and forward compatibility :(
If you've just changed the class in a compatible way, you could try setting the serialVersionUID to -3071143254300957400 explicitly... it looks like you're currently setting it to 1. In general I'd try to move away from the default serialization though, if at all possible.
精彩评论