title: Jackson Builder Pattern causes message Body Reader not found
body: <p>I am attempting to use the <code>@JsonDeserialize(builder = class)</code> annotation example for Jackson to allow for the builder pattern. I tried to use my objects but kept running into an error. I then copied this example from the Jackson webpage, but it is still not working.
  Here is my sample files:</p>
  
  <p>Data Item</p>
  
  <pre><code>package org.cpicard.finance;
  import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
  
  @JsonDeserialize(builder=ExampleBuilder.class)
  public class Example {
     private final int x, y;
     protected Example(int x, int y) {
        this.x = x;
        this.y = y;
     }
  }
  </code></pre>
  
  <p>Builder</p>
  
  <pre><code>package org.cpicard.finance;
  public class ExampleBuilder {
     private int x, y;
     public ExampleBuilder () { }
  
     public ExampleBuilder withX(int x) {
        this.x = x;
        return this;
     }
     public ExampleBuilder withY(int y) {
        this.y = y;
        return this;
     }
  
     public Example build() {
        return new Example(x, y);
     }
  }
  </code></pre>
  
  <p>Rest Service</p>
  
  <pre><code>package org.cpicard.finance;
  
  import javax.ws.rs.Consumes;
  import javax.ws.rs.POST;
  import javax.ws.rs.Path;
  import javax.ws.rs.core.MediaType;
  import javax.ws.rs.core.Response;
  
  import org.cpicard.model.finance.Example;
  
  @Path("/account")
  public class AccountService {
  
     @POST
     @Consumes(MediaType.APPLICATION_JSON)
     @Path("test1")
     public Response createAccount1(final Example account) {
        System.out.println(account.toString());
        return Response.ok().build();
     }
  }
  </code></pre>
  
  <p>Application Config</p>
  
  <pre><code>package org.cpicard.finance;
  
  import java.util.Collections;
  import java.util.HashSet;
  import java.util.Set;
  
  import javax.ws.rs.ApplicationPath;
  import javax.ws.rs.core.Application;
  
  @ApplicationPath("/rs")
  public class ApplicationConfig extends Application {
  
     private final Set&lt;Class&lt;?&gt;&gt; classes;
  
     public ApplicationConfig() {
        final HashSet&lt;Class&lt;?&gt;&gt; c = new HashSet&lt;&gt;();
        c.add(AccountService.class);
  
        classes = Collections.unmodifiableSet(c);
     }
  
     @Override
     public Set&lt;Class&lt;?&gt;&gt; getClasses() {
        return classes;
     }
  }
  </code></pre>
  
  <p>Web xml Snippet</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
          &lt;param-value&gt;org.cpicard.finance.ApplicationConfig&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
   &lt;/servlet&gt;
   &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/rs/*&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>This results in the following error:<br></p>
  
  <blockquote>
    <p>[2015-03-01T10:30:19.576-0700] [glassfish 4.1] [SEVERE] []
    [org.glassfish.jersey.message.internal.ReaderInterceptorExecutor]
    [tid: _ThreadID=31 _ThreadName=http-listener-1(4)] [timeMillis:
    1425231019576] [levelValue: 1000] [[   MessageBodyReader not found for
    media type=application/json, type=class
    org.cpicard.model.finance.Example, genericType=class
    org.cpicard.model.finance.Example.]]</p>
  </blockquote>
  
  <p>When I switch the data item to a standard object that has regular getters and setters it works fine. I am thinking there is something incorrect in my configuration, but not sure what it could be.</p>
  
  <p>Using Glassfish 4.1</p>