Results 1 to 4 of 4

Thread: Facebook Photo class unable to deserialize a from database.

  1. #1
    Join Date
    Feb 2012
    Posts
    29

    Unhappy 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. #2
    Join Date
    Apr 2012
    Posts
    1

  3. #3
    Join Date
    Aug 2004
    Posts
    1,099

    Default

    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).
    Craig Walls
    Spring Social Project Lead

  4. #4

    Default

    Quote 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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •