Note: To make the most voted solution work, attributes in the POJO have to be public or have a public getter / setter: By default, Jackson 2 will only work with fields that are either public, or have a public getter method – serializing an entity that has all fields private or package private will fail. Not tested yet, but I believe that this rule also applies for other JSON libs like google ...