Uploaded image for project: 'Slider'
  1. Slider
  2. SLIDER-454

Jersey doesn't marshall @JsonProperty annotated fields correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Cannot Reproduce
    • Slider 0.60
    • Slider 0.60
    • agent, agent-provider
    • None
    • Slider October #1

    Description

      Scanning the code, the only JSON-marshalled classes that declare their json property fields are the Agent ones ... most of which match their field names completely.

      some are different, e.g in org.apache.slider.server.appmaster.web.rest.agent.HostInfo:

        @JsonProperty("uptime_hours")
        public long getUptimeHours() {
          return this.uptime_hours;
        }
      
        @JsonProperty("uptime_hours")
        public void setUpTimeHours(long uptime_hours) {
          this.uptime_hours = uptime_hours;
        }
      
        @JsonProperty("uptime_days")
        public long getUpTimeDays() {
          return this.uptime_days;
        }
      
        @JsonProperty("uptime_days")
        public void setUpTimeDays(long 
      

      This may work for the agent POSTing data to the AM, as it is not Jersey itself publishing it —but if the AM did ever try to serve the same data up on its REST endpoints, the fields would not be marshalled correctly.

      Attachments

        Activity

          People

            gsaha Gour Saha
            stevel@apache.org Steve Loughran
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: