title: How to resolve Uncaught exception thrown by REST service: Unrecognized field "input"
body: <p>Hi I am writing a rest service where user enters the value in dialogue box and via Ajax it update the Active object table. But I keep getting 
  Uncaught exception thrown by REST service: Unrecognized field "input".</p>
  
  <pre><code>@Consumes({MediaType.APPLICATION_JSON})
  @Produces({MediaType.APPLICATION_JSON})
  @Path("/message")
  public class LeangearsRestResource {
  
  
      ActorConfService ActorConfService;
  
      private final ApplicationProperties applicationProperties;
      public LeangearsRestResource(ApplicationProperties applicationProperties, ActorConfService actorConfService){
          this.applicationProperties = applicationProperties;
          this.actorConfService = actorConfService;
      }
      static final javax.ws.rs.core.CacheControl NO_CACHE = new javax.ws.rs.core.CacheControl();
  
      @POST
      @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
      public Response addMessage(ActorBeans actorBeans)
      {
  
          if(actorConfService.add(actorBeans.getActor(),actorBeans.getRole()))
          {
              return Response.ok(new Result(true)).cacheControl(NO_CACHE).build();
          }
          return Response.ok(new Result(false)).cacheControl(NO_CACHE).build();
      }
  </code></pre>
  
  <p>ActorBean.java</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  public class ActorBeans {
  
  
  /*
      @XmlElement(name = "projectName")
      String productName;*/
      @XmlElement(name = "actor")
      String actor;
      @XmlElement(name = "role")
      String role;
  
      public ActorBeans() {
      }
  
      public ActorBeans(String productName, String actor, String role){
          /*this.productName = productName;*/
          this.actor = actor;
          this.role =role;
      }
  
      /*public void setProductName(String productName) {
  
          this.productName = productName;
      }
  
      public String getProductName(){
  
          return productName;
      }*/
  
  
      public String getActor() {
          return actor;
      }
  
      public void setActor(String actor) {
          this.actor = actor;
      }
  
      public String getRole() {
          return role;
      }
  
      public void setRole(String role) {
          this.role = role;
      }
  }
  </code></pre>
  
  <p>actor.js</p>
  
  <pre><code>function actor_createPostAjaxOptions (data, data1) {
      return {
          "cache": false,
          "contentType": 'application/json',
          "dataType": 'json',
          "data": JSON.stringify(data, data1),
          "processData": false,
          "type": 'POST'
      };
  }
  
  function actor_createDeleteAjaxOptions (data) {
      return {
          "cache": false,
          "contentType": 'application/json',
          "dataType": 'json',
          "data": JSON.stringify(data),
          "processData": false,
          "type": 'DELETE'
      };
  }
  
  
  
  
  AJS.$( function(){
      // Standard sizes are 400, 600, 800 and 960 pixels wide
      var actor_dialog = new AJS.Dialog({
          width: 400,
          height: 300,
          id: "example-dialog",
          closeOnOutsideClick: true
      });
  
      // PAGE 0 (first page)
      // adds header for first page
      actor_dialog.addHeader("Actor");
  
      // add panel 1
      actor_dialog.addPanel("Panel 1", "&lt;input id='dialoginput' type='text' value=''&gt;Actor1&lt;/input&gt;" + "&lt;br&gt;" + "&lt;input id='dialoginput1' type='text' value=''&gt;Actor2&lt;/input&gt;" , "panel-body");
  
  
      actor_dialog.addLink("Cancel", function (actor_dialog) {
          actor_dialog.hide();
      }, "#");
  
  
  
      actor_dialog.addSubmit(
          "Submit",
          function(actor_dialog) {
              actor_dialog.hide();
              AJS.log(AJS.$("#dialoginput").val());
              data = {input:AJS.$("#dialoginput").val()};
  
              data1 = {input:AJS.$("#dialoginput1").val()};
              jQuery.ajax(
                  AJS.params.baseURL+"/rest/leangearsrestresource/1.0/message",
                  actor_createPostAjaxOptions(data, data1)
              )
              AJS.$("#test").html(AJS.$("#dialoginput").val())
              AJS.$("#test1").html(AJS.$("#dialoginput1").val())
          }
      );
  
      // Add events to dialog trigger elements
      AJS.$("#dialog-button").click(function() {
          // PREPARE FOR DISPLAY
          // start first page, first panel
          //debugger;
  
          //call ajax to get existing value
          jQuery.ajax(
              AJS.params.baseURL+"/rest/leangearsrestresource/1.0/message",
              {
                  "cache": false,
                  "processData": false,
                  "type": 'GET',
                  "contentType": 'application/json',
                  "dataType": 'json'
              }).done(function(result) {
  
                  AJS.log(result);
  
                  AJS.$("#dialoginput").val(result.value);
                  actor_dialog.gotoPage(0);
                  actor_dialog.gotoPanel(0);
                  actor_dialog.show();
  
  
  
              }).fail(function() {
                  AJS.log("failed get GET");
  
              });
  
  
      });
  
  })
  </code></pre>