본문 바로가기

DEV/JAVA

페이스북 로그인 스프링 (#12) bio field is deprecated for versions v2.8 and higher error (facebook spring) 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", .. 더보기
Spring RestTemplate 요청시 403 에러 날때 해결법 문제점 RestTemplate 으로 외부 api 찌르는데 403 에러가 난다. org.springframework.web.client.HttpClientErrorException: 403 Forbidden해결법아래와 같이 헤더에 uger agent 정보를 입력해 준다. RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.valueOf("text/plain;charset=utf-8")); headers.add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" + " AppleWebKit/5.. 더보기
jhipster gradle 인텔리제이에서 실행이 안되는 문제 문제jhipster gradle 기반 intellij 에서 실행 시키면 아래와 같은 에러가 났다. Description: Parameter 1 of constructor in service required a bean of type Mapper' that could not be found. Action: Consider defining a bean of type 'Mapper' in your configuration. 해결법그래들 파일에 아래 플러그인을 추가해준다. plugins { id 'net.ltgt.apt' version '0.9' } apply plugin: 'idea' apply plugin: "net.ltgt.apt" 출처https://github.com/jhipster/generator-j.. 더보기
google cloud storage + 스프링 부트 서버에서 이미지 업로드 하기 Azure와 Amazon s3 스토리지를 써보다 구글이 처음에주는 300불이 1년까지 연장된거 보고 한번 써보기로 했다. 해야될 일을 크게 3가지로 요약하면 아래와 같다. 1 .구글 스토리지 생성 2. 인증서 다운로드 3. 서버에서 구글 스토리지로 업로드 1. 스토리지 생성 2. bucket 생성 버켓이름은 다른 사람이 생성한 이름과 중복이 안되는 고유한 값이어야하며 중요한 정보를 적으면 안된다. 3. 인증서 생성 및 다운로드 아래 순서대로 한후 인증서 json 파일을 다운로드 받는다. 순서는 - 구글 클라우드 네입게이션의 API Manager 선택 - Create Credentials - service account key - service account name 입력 role project owner.. 더보기
스프링 mybatis 오라클 12c 연동 에러 기존에 하던 프로젝트 환경을 바꾸면서 삽질한걸 정리한다. 기존 환경os : osx 요세미티jdk : 1.7tomcat : 8db : mysqlide : intellij 14 새로운 환경os : windows 8.1jdk : 1.8tomcat : 8db : oracle 12cide : intellij 14 기존 환경을 새로운 환경에 세팅하니 db접속이 안된다 에러내용org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConne.. 더보기
TOMCAT 8 getRealPath return null 이번에 톰캣 7에서 돌리던 프로젝트를 8에서 돌리게 되었다.다른건 문제가 없었는데 기존에 잘되던 업로드가 안되었다.getServletContext().getRealPath("resources/images/inquiryImageFile");이부분에서 null 에러가 났다.구글링을 해보니 해결책은 getServletContext().getRealPath("/resources/images/inquiryImageFile");/붙여주니 잘돌아간다^^ 출처 : http://stackoverflow.com/questions/25555541/getservletcontext-getrealpath-in-tomcat-8-returns-wrong-path 더보기