problem_table 관련 API가 이상하게 작동 X
터미널에 뜨는 로그를 확인해보니,
ProblemEntity 클래스의 sample 필드가 int 타입인데, 여기에 null 값을 할당하려고 했기 때문에 발생
=> 기본형 타입(int, long, boolean, 등)은 null 값을 가질 수 없음
null 값을 허용해야 한다면 해당 필드를 래퍼 타입(Integer, Long, Boolean, 등)으로 변경!
해결 완료 Vv
screen 명령어를 사용해서 새로운 session을 열어서 jar 파일을 실행시킨 다음, 새로운 창을 열어서 실행 상태를 유지한 채 빠져나옴(detached)
참고: screen 명령어 사용법
배포하다가 git clone을 하는데 자꾸 중복된 디렉터리가 있다고 해서 원래 있던 폴더를 날리고 새로 git clone해서 만들었다.
build 후 jar 파일을 실행하는데 failed 띠로리
알고보니 application.properties를 작성해서 DB와 연결시켜줘야 함
cd src
cd main
mkdir resoures
cd resources
현재 위치: 프로젝트명/src/main/resources
nano application.properties
작성 예시
spring.datasource.url=jdbc:mysql://RDBS 엔드포인트/DB명
spring.datasource.username=사용자명
spring.datasource.password=비밀번호
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.open-in-view=false
jwt.secret=secretKey
작성 후 저장하고 나가기
Ctrl + O
파일명 입력하고 엔터, 엔터
Ctrl + X
build.gradle가 있는 위치로 이동 후 수정
nano build.gradle
DB 관련 dependency 추가
ex. implementation 'com.mysql:mysql-connector-j'
빌드
./gradlew build
이렇게 하고 jar 실행하니까 오류 없이 잘됨~~