如何在Wildfly中配置Jackson?
我有一个会话豆,具有以下方法:
@POST
@Consumes("application/x-www-form-urlencoded")
@Path("/calculate")
@Produces("application/json")
public CalculationResult calculate(@FormParam("childProfile") String childProfile,
@FormParam("parentProfile") String parentProfile) {
...
}
返回的计算结果无法映射到 JSON,并且会发生以下异常:
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class com.test.UniqueName and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)...
如何在Wildfly中配置Jackson及其功能?SerializationFeature