I think this is somehow related to the fact that when serializing, Java runtime does not have type information available to know values are of type UUIDInfo; rather, all it sees is something like "Map<?,?>". So if UUIDInfo has @JsonTypeInfo annotation, its type information is NOT included.

But when deserializing, you are specifying the type, in which case type information would be expected; and this causes error.

If this is the problem, you can have a look at this wiki entry, for suggestions on how to resolve the issue -- this is a sort of FAQ question, unfortunately, but also something Jackson can not solve due to Java Type Erasure.

I added a "wrapper" class called UUIDMap that is a simple Pojo that contains the Map<String, UUIDInfo> cache as it's member and public setters/getters. I've also added the @JsonTypeInfo annotation to both the UUIDMap (wrapper) and the UUIDInfo pojo, which gives a json of...

Btw, no need for wrapper object necessarily; and if you didn't have @JsonTypeInfo, no need to add -- just guessing you might have had it.

Instead, easier would be to define:

public class StringUuidMap extends HashMap<String,UUIDInfo> { }

(and/or add constructors in there)

Because then you can in fact serialize the thing right without passing explicit type information either when serializing or deserializing. This is due to inheritance relationship which retains key/value types in class code. So perhaps you could try that instead.

But knowing the error here would help to make sure we know what the exact problem is.

Unfortunately that does not make any sense: this exception should not result from JSON shown. What environment is this on? Does it occur with Jackson serialization to a String, printing out JSON, then deserializing? Or is there some other software component handling things in between?