반응형
Jhipster로 페이스북 로그인을 구현하던중
(#12) bio field is deprecated for versions v2.8 and higher와 같은 에러가 발생하였다. 페이스북 라이브러리를 3점대로 바꾸면된다는데 이거는 안해봤고
아래와같이 social service 에 적어준다.
@PostConstruct
private void init() {
try {
String[] fieldsToMap = {
"id", "about", "age_range", "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();
}
}
@PostConstruct
private void init() {
try {
String[] fieldsToMap = {
"id", "about", "age_range", "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();
}
}
출처 : https://github.com/jhipster/generator-jhipster/issues/2349
반응형
'DEV > JAVA' 카테고리의 다른 글
Spring RestTemplate 요청시 403 에러 날때 해결법 (0) | 2017.08.01 |
---|---|
jhipster gradle 인텔리제이에서 실행이 안되는 문제 (0) | 2017.08.01 |
google cloud storage + 스프링 부트 서버에서 이미지 업로드 하기 (0) | 2017.07.30 |
스프링 mybatis 오라클 12c 연동 에러 (1) | 2015.04.09 |
TOMCAT 8 getRealPath return null (0) | 2015.03.19 |