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:
does not find 'images' since it is not in the output JSON from a naive mapping.Code:private Photo(String id, Reference from, String link, String icon, Date createdTime, List<Image> images) {
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
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?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)


Reply With Quote
