I am trying to serialize a Java Dynamic proxy using the Jackson library, but I am getting this error:
public interface IPlanet { String getName(); } Planet implements IPlanet { private String name; public String getName(){return name;} public String setName(String iName){name = iName;} } IPlanet ip = ObjectsUtil.getProxy(IPlanet.class, p); ObjectMapper mapper = new ObjectMapper(); mapper.writeValueAsString(ip);
I get this exception:
Exception in thread "main" com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class $Proxy11 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.SerializationFeature.FAIL_ON_EMPTY_BEANS) )
The problem seems the same as when merging proxied objects with hibernation, but I donβt know how and if I can use the Jackson-hibernate module to solve my problem.
UPDATE : BUG was resolved from Jackson 2.0.6 release
source share