Without a stack trace, it is hard to guess the exact problem, but I'm going to go out on a limb and suggest two possibilities:
The hashmap at runtime doesn't contain serializable objects. Given the generic type that you present, this would only be possible if a raw type was used. Such as:
public void setMap(HashMap map) { this.map = map; }
That would give you a compiler warning, but it would compile so something like that may be going on. The same thing would happen if you had a getter on the map, and something referenced the map using its raw type. Say:
public Map<String, String> getMap() { return map; }
Map m = getMap();
m.put(new Object(), new Object());
The other possibility I can think of is that you are corrupting the file in some way when you write or read it (say doing something with file encoding or not closing the stream when you write it).
Without more information (the complete stack trace - cut out the lines referencing your own project name if you need, but no others) and the code which does the serialization and deserialization, it is impossible to get further insight into the problem.
By the way, no comment or answer thinks that you serialized a HashMap and want to deserialize MyClass (it isn't really possible - you can't decide what class you get when you deserialize). I think you are misunderstanding the comments. What they are talking about is different versions of MyClass as they have existed over time. I'm guessing in my answer that this is not the case (you are in fact serializing MyClass fresh during the running of the code and deserializing without any recompilation in-between. If not (if in fact you serialized the class, changed it, and recompiled and are trying to re-read an old file), then akf's answer with Tom's comments are on the right track.