我们正在使用Spring Social Facebook API
和最新版本(2.02)。它工作正常,直到今天。 Facebook似乎将Video Upload Limits
的返回值从Integer
更改为Long
。
有人有同样的问题吗?
我想确定这是否是因为Facebook API更改而产生的问题。
提前致谢。
答案 0 :(得分:1)
请注意,此问题已经过报告,确认和修复。请参阅https://jira.spring.io/browse/SOCIALFB-198。
即将推出维护版本,可能是今天。
与此同时,如果上述解决方法有效,请随时暂时使用。
答案 1 :(得分:0)
从这里回答:Spring social facebook login error - Numeric value out of range of int
@PostConstruct
private void init() {
// hack for the facebook login
try {
String[] fieldsToMap = {
"id", "about", "age_range", "address", "bio", "birthday", "context", "cover", "currency", "devices", "education", "email",
"favorite_athletes", "favorite_teams", "first_name", "gender", "hometown", "inspirational_people", "installed", "install_type",
"is_verified", "languages", "last_name", "link", "locale", "location", "meeting_for", "middle_name", "name", "name_format",
"political", "quotes", "payment_pricepoints", "relationship_status", "religion", "security_settings", "significant_other",
"sports", "test_group", "timezone", "third_party_id", "updated_time", "verified", "viewer_can_send_gift",
"website", "work"
};
Field field = Class.forName("org.springframework.social.facebook.api.UserOperations")
.getDeclaredField("PROFILE_FIELDS");
field.setAccessible(true);
Field modifiers = field.getClass().getDeclaredField("modifiers");
modifiers.setAccessible(true);
modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(null, fieldsToMap);
} catch (Exception ex) {
ex.printStackTrace();
}
}
此解决方法已在实时环境中进行了测试。