Announcement Announcement Module
Collapse
No announcement yet.
Facebook Photo class unable to deserialize a from database. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facebook Photo class unable to deserialize a from database.

    Situation:
    Got a spring-facebook Photo object (1.1.0 snapshot), then serialized to database.
    (mongo, which uses a JSON like structure)
    On de-serialize, it blows up because the constructor requires a field that is not in the serialized map:
    Code:
    private Photo(String id, Reference from, String link, String icon, Date createdTime, List<Image> images) {
    does not find 'images' since it is not in the output JSON from a naive mapping.

    the Photo object slices the images object into individual Image objects, which get stored in the map instead of the original List<Image>
    Thus upon reanimation, we see
    Code:
    java.lang.IllegalArgumentException: No property images found for type class org.springframework.social.facebook.api.Photo
    	at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:73)
    	at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:92)
    	at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:312)
    	at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:294)
    	at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:258)
    	at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:239)
    	at org.springframework.data.mongodb.core.convert.MappedConstructor$MappedParameter.<init>(MappedConstructor.java:125)
    Is there a clever way around this? Do I need to make a custom writer that repackages the individual images into an array, so the re-creation happens smoothly? Or should I make more changes to the spring-facebook jars?

  • #2
    i wish i knew too!

    Comment


    • #3
      Just hang tight...I'm soon going to be exposing the images array as a property on Photo, which should solve your problem (among others).

      Comment


      • #4
        Originally posted by habuma View Post
        Just hang tight...I'm soon going to be exposing the images array as a property on Photo, which should solve your problem (among others).
        Can't wait to see your solution on this.

        Comment

        Working...
        X