Error creating bean with name 'entityManagerFactory' defined in class path resource ... org/hibernate/boot/model/naming/CamelCaseToUnderscoresNamingStrategy 오류 해결방법 스프링 부트는 org.springframework.boot.orm.jpa.SpringNamingStrategy 으로 밑줄로 카멜케이스 이름을 분할하여 사용한다. application.properties에 아래 내용 추가하면 해결완료 spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl 에러 2022.08.18
Swagger 라이브러리 사용하기(API 명세서 자동화) Swagger 란? 프로젝트 내의 API 명세서를 자동으로 만들어 HTML 화면으로 보여주는 라이브러리이다. 설정방법 1. pom.xml 또는 build.gradle 에 라이브러리 추가 io.springfox springfox-swagger2 2.9.2 io.springfox springfox-swagger-ui 2.9.2 // https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2' // https://mvnrepository.com/artifact/io.springfox/springfox-sw.. 스프링 2022.08.18
@RestController와 @RequestMapping @RestController - 스프링 프레임워크 4 버전 부터 사용가능한 어노테이션 - @Controller + @ResponseBody - 문자열과 REST Data(JSON/XML)을 전송할 수 있음 - View를 거치지 않고 HTTP ResponseBody에 직접 Return 값을 담아서 보냄 @RequestMapping - MVC 핸들러 매핑을 위하여 사용 - 컨트롤러의 메서드와 RequestMapping으로 URL 매핑하여 경로 설정 - Value: "{URL}", method: GET, POST, DELETE, PUT, PATCH - 스프링 프레임워크 4.3 버전 부터는 메서드 지정 방식보다 간단한 아래 어노테이션 사용 @GetMapping, @PostMapping, @DeleteMappin.. 스프링 2022.08.17
리눅스 (vim 편집기 명령어, 파일/폴더의 이동, 이름변경, 복사) vim 편집기 명령어 새로운 파일 생성 vi test.txt a - 내용 입력 (INSERT) ESC + : + w 》 저장 ESC + : + q 》 나가기 ESC + : + wq! 》 강제로 저장하고 나가기 ESC + / + 찾고싶은 단어 》 단어 검색할 수 있음 ( n : 다음 단어 찾기, shift + n : 이전 단어 찾기 ) dd 》 한 줄 삭제 shift + g 》 문서의 맨 뒤로 이동 파일/폴더 삭제 rm 》 파일 삭제 rm -d 》 폴더 삭제 (= rmdir) rm -r 》 하위 존재하는 파일도 함께 삭제 rm-ri 》 하위 존재하는 파일을 삭제할때 마다 물어보는 옵션 rm-rf 》 하위 존재하는 파일을 물어보지 않고 전부 삭제하는 옵션 파일/폴더 위치 이동, 이름 변경 mv 》 파일이나 .. 리눅스 2022.08.07
리눅스 기본 명령어 ncal / cal / date * 옵션(-h...)을 확인하고 싶으면 man ncal, man cal, man date ..와 같이 man 명령어 입력 또는 help 명령어 입력 (type ncal, type cd, type ls .. 와 같이 입력하여 명령어 type을 확인하여 man 또는 help 명령어 사용) echo echo test//콘솔에 'test'라는 글자가 그대로 출력됨 echo test > test.txt //'test.txt'파일에 'test'라는 글자가 입력되어 생성됨 pwd: 현재 내가 있는 폴더 위치를 보여줌 pwd ls: 폴더 목록 조회 ls -l // -l: 상세하게 조회 ls -lt// -t: 시간순으로 정렬하여 조회 ls -ltr // -r: 역정렬하여 조회 ls -la.. 리눅스 2022.07.29
기존 프로젝트에 새로운 프로젝트 추가한 다음 깃허브에 연동하기(이클립스) 새로 추가된 프로젝트 우클릭 → Team → share project → Repository에 기존 로컬 저장소 선택 git 2022.06.21
스프링부트 이메일 발송(구글 계정 이용) 1. spring-boot-starter-mail 라이브러리 추가 // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-mail implementation group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '2.6.3' 2. application.properties 에 설정 세팅 spring.mail.host=smtp.gmail.com spring.mail.port=587 spring.mail.username= //구글 계정 xxxxxxxxxxx@google.com spring.mail.password= //구글 보안 ->.. 스프링 2022.06.20
스프링부트 웹소켓 실시간 푸시 알림(좋아요, 댓글) 1. 스프링부트 웹 소켓 라이브러리 추가 // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-websocket implementation group: 'org.springframework.boot', name: 'spring-boot-starter-websocket' 2. EchoHandler 작성 package com.reviewer.portfolio.controller; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.stereot.. 스프링 2022.06.20
웹 서버와 WAS를 분리하는 이유? 웹 서버란? 클라이언트의 요청 중 정적 컨텐츠를 담당하여 처리하는 서버 ex) Apache, Nginx ... WAS란? DB 조회나 프로그램에 대한 처리 결과를 요구하는 동적인 컨텐츠를 처리하기 위해 만들어진 애플리케이션 서버 WAS = Web Server + Web Container ex) Apache Tomcat, JEUS ... 웹 서버와 WAS를 분리하는 이유? 1. WAS가 정적컨텐츠와 동적컨텐츠를 모두 처리하게 되면 서버에 부하가 발생하게 된다. 따라서, 웹서버가 정적인 컨텐츠를 처리하고, WAS는 동적인 컨텐츠만을 처리하도록 기능을 분리하여 서버의 부하를 방지할 수 있다. 2. 웹 서버에 여러 대의 WAS를 연결할 수 있기 때문에 웹 서버에서 많은 요청을 받아서 WAS로 적절하게 분배하여 .. 카테고리 없음 2022.06.09
[Spring] log4jdbc-log4j2 설정하기(콘솔에 sql문 로그 찍기) 1. log4jdbc-log4j2 라이브러리 추가(build.gradle) // https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 implementation group: 'org.bgee.log4jdbc-log4j2', name: 'log4jdbc-log4j2-jdbc4.1', version: '1.16' 2. application.properties의 datasource url, driver-class-name 변경 # db #spring.datasource.driverClassName=org.mariadb.jdbc.Driver spring.datasource.driver-class-name=net.sf.. 스프링 2022.05.25