-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Milestone
Description
Here's a simple test case that will reproduce this issue. jackson version: 2.4.0
@JsonIdentityInfo(generator = ObjectIdGenerators.UUIDGenerator.class, property = "@id")
public static class D{
public D next;
}
@Test
public void testSmileFormat() throws JsonGenerationException, JsonMappingException, IOException{
ObjectMapper mapper = new ObjectMapper(new SmileFactory());
D d = new D();
d.next = d;
mapper.enable(SerializationFeature.INDENT_OUTPUT);
ByteArrayOutputStream os = new ByteArrayOutputStream();
mapper.writeValue(os, d);
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
ObjectMapper m2 = new ObjectMapper(new SmileFactory());
D de = m2.readValue(is, D.class); //this will throws an exception.
}
The exception thrown are like :
com.fasterxml.jackson.databind.JsonMappingException: Problem deserializing property 'next' (expected type: [simple type, class JacksonTest$D]; actual type: [B), problem: Can not set JacksonTest$D field JacksonTest$D.next to [B (through reference chain: jacksonhack.D["next"]).
Thanks.
Metadata
Metadata
Assignees
Labels
No labels