I have the following simple class:
import org.codehaus.jackson.annotate.JsonIgnoreProperties; @JsonIgnoreProperties({ \"thirdField\" }) public class Message
You've mixed different versions of Jackson. Notice that you import JsonIgnoreProperties from org.codehaus.jackson.annotate (version 1.x) while you're using ObjectMapper from com.fasterxml.jackson.databind (version 2.x).
JsonIgnoreProperties
org.codehaus.jackson.annotate
ObjectMapper
com.fasterxml.jackson.databind