Announcement Announcement Module
Collapse
No announcement yet.
FacebookTemplate.fetchObject() Failed due to Unrecognized field "degree" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FacebookTemplate.fetchObject() Failed due to Unrecognized field "degree"

    Hi All,

    I am using Spring Social M3 and it failed during the deserialization of Facebook user profile. Looks like class org.springframework.social.facebook.api.EducationE ntry doesn't support a school with a degree.

    Here is a snippet of a school in JSON that came back from Facebook:

    {
    "school":{
    "id":"1122714554111",
    "name":"University of Miami"
    },
    "degree":{
    "id":"109903862412222",
    "name":"Master of Science"
    },
    "concentration":[
    {
    "id":"183059611734444",
    "name":"Software Engineering"
    }
    ],
    "type":"Graduate School"
    }

    Here is the stack trace:

    SEVERE: Servlet.service() for servlet Spring MVC Dispatcher Servlet threw exception
    org.codehaus.jackson.map.exc.UnrecognizedPropertyE xception: Unrecognized field "degree" (Class org.springframework.social.facebook.api.EducationE ntry), not marked as ignorable
    at [Source: org.apache.http.conn.EofSensorInputStream@73905690 ; line: 1, column: 644] (through reference chain: org.springframework.social.facebook.api.EducationE ntry["degree"])
    at org.codehaus.jackson.map.exc.UnrecognizedPropertyE xception.from(UnrecognizedPropertyException.java:5 3)
    at org.codehaus.jackson.map.deser.StdDeserializationC ontext.unknownFieldException(StdDeserializationCon text.java:244)
    at org.codehaus.jackson.map.deser.StdDeserializer.rep ortUnknownProperty(StdDeserializer.java:589)
    at org.codehaus.jackson.map.deser.StdDeserializer.han dleUnknownProperty(StdDeserializer.java:575)
    at org.codehaus.jackson.map.deser.BeanDeserializer.ha ndleUnknownProperty(BeanDeserializer.java:684)
    at org.codehaus.jackson.map.deser.BeanDeserializer.ha ndleUnknownProperties(BeanDeserializer.java:704)
    at org.codehaus.jackson.map.deser.BeanDeserializer._d eserializeUsingPropertyBased(BeanDeserializer.java :652)
    at org.codehaus.jackson.map.deser.BeanDeserializer.de serializeFromObject(BeanDeserializer.java:473)
    at org.codehaus.jackson.map.deser.BeanDeserializer.de serialize(BeanDeserializer.java:351)
    at org.codehaus.jackson.map.deser.CollectionDeseriali zer.deserialize(CollectionDeserializer.java:119)
    at org.codehaus.jackson.map.deser.CollectionDeseriali zer.deserialize(CollectionDeserializer.java:96)
    at org.codehaus.jackson.map.deser.CollectionDeseriali zer.deserialize(CollectionDeserializer.java:25)
    at org.codehaus.jackson.map.deser.SettableBeanPropert y.deserialize(SettableBeanProperty.java:230)
    at org.codehaus.jackson.map.deser.BeanDeserializer._d eserializeUsingPropertyBased(BeanDeserializer.java :615)
    at org.codehaus.jackson.map.deser.BeanDeserializer.de serializeFromObject(BeanDeserializer.java:473)
    at org.codehaus.jackson.map.deser.BeanDeserializer.de serialize(BeanDeserializer.java:351)
    at org.codehaus.jackson.map.ObjectMapper._readMapAndC lose(ObjectMapper.java:2131)
    at org.codehaus.jackson.map.ObjectMapper.readValue(Ob jectMapper.java:1455)
    at org.springframework.http.converter.json.MappingJac ksonHttpMessageConverter.readInternal(MappingJacks onHttpMessageConverter.java:135)
    at org.springframework.http.converter.AbstractHttpMes sageConverter.read(AbstractHttpMessageConverter.ja va:154)
    at org.springframework.web.client.HttpMessageConverte rExtractor.extractData(HttpMessageConverterExtract or.java:74)
    at org.springframework.web.client.RestTemplate.doExec ute(RestTemplate.java:446)
    at org.springframework.web.client.RestTemplate.execut e(RestTemplate.java:415)
    at org.springframework.web.client.RestTemplate.getFor Object(RestTemplate.java:213)
    at org.springframework.social.facebook.api.impl.Faceb ookTemplate.fetchObject(FacebookTemplate.java:161)
    at org.springframework.social.facebook.api.impl.UserT emplate.getUserProfile(UserTemplate.java:36)
    at org.springframework.social.facebook.api.impl.UserT emplate.getUserProfile(UserTemplate.java:32)

  • #2
    This should already be fixed in the latest snapshot build. Could you try that and let us know if it works for you? Thanks!

    Comment


    • #3
      Thanks Craig.

      Yep, this issue is fixed in latest snapshot build.

      Comment

      Working...
      X