users@jersey.java.net

[Jersey] ObjectMapper.writeValueAsString causes java.lang.IllegalStateException

From: Pritam Moodbidri <pritam_at_yahoo-inc.com>
Date: Tue, 24 Mar 2015 17:17:19 +0000 (UTC)

Hi,
I am upgrading Jersey from 2.7 to 2.17, and also relatively Jackson from 1.x to 2.x. 
One of the function was using ObjectMapper.writeValueAsString, and using the bean as an argument. The bean is using @JsonProperty for an element in it, which has a different name, than the element variable name, which is throwing the exception
java.lang.IllegalStateException: Conflicting/ambiguous property name definitions (implicit name 'myElements'): found multiple explicit names: [myElements, my_elements], but also implicit accessor: [field .....#myElements][visible=false,ignore=false,explicitName=false]
Do I need to add something more with Jersey 2.17? - Pritam