전체 글 135

Docker mysql 시간 변경, vi command not found, docker 서버 시간 변경

SELECT NOW(), @@system_time_zone; -- [현재시간 -9시간],UTC 1. docker mysql 컨테이너아이디 조회 $docker ps -a CONTAINER_ID IMAGE [CONTAINER_ID] mysql 2. docker mysql 접속 $ sudo docker exec -it [CONTAINER_ID] /bin/bash bash-4.4# vi /etc/my.cnf [mysqld] default_time_zone = '+09:00' [mysqld] # 아래 추가 default_time_zone = '+09:00' 3. docker mysql 재기동 $ sudo docker stop [CONTAINER_ID] $ sudo docker start [CONTAINER_ID]..

DB/My SQL 2023.02.23

[Error] ClassNotFoundException: org.apache.http.impl.client.HttpClients

Springframework 의 RestTemplate 이용 하여, http 통신 구성 시 , public static ResponseEntity send(String url, HttpMethod method, HttpHeaders header, Map params, Class responseType) { HttpComponentsClientHttpRequestFactory httpFactory = new HttpComponentsClientHttpRequestFactory(); httpFactory.setConnectTimeout(5*1000); httpFactory.setReadTimeout(5*1000); RestTemplate restTemplate = new RestTemplate(httpFac..

skill/Java.Kotlin 2023.02.22

[MYSQL] SQL Error [10930][HY000] : You can't specify target table 해결

mysql insert문 안에 select문 있을 시, error 발생 SQL Error [10930][HY000] : You can't specify target table insert into table_name (column1, column2, column3) values ((select ifnull(max(seq), 0) + 1 from table_name), 'value2', 'value3') 해결! insert문 안에 select max 함수를 사용 할 때는, select max 함수 table에 별칭 추가 insert into table_name (column1, column2, column3) values ((select ifnull(max(seq), 0) + 1 from table_nam..

DB/My SQL 2023.02.16

Springboot request param VO class로 받을 시, 필수 값 null일 경우 exception handler 처리

Springboot request param VO class로 받을 시, 필수 값 null일 경우 exception handler 처리 RestController @RequestMapping("/test") @RestController public class TestController { @GetMapping(value = "/t1") public Map t1( @Validated ReqVo req) { Request Param VO import lombok.Data; import javax.validation.constraints.NotNull; @Data public class ReqVo{ /** * 필수코드 @NotNull 선언 */ @NotNull String code_type; Exception..

skill/Java.Kotlin 2023.02.01

Springboot @RequestParam null 일 경우, exception handler 처리

springboot restcontroller requestparam 설정 @GetMapping(value = "/test") public Map accounts( @RequestParam(value = "code") String code, @RequestParam(value = "page" , required = false, defaultValue = "0") int page, @RequestParam Map req) throws Exception { @RequestParam 필수값 exception handler 잘못된 예 @ControllerAdvice @RestController public class ResponseExceptionHandler extends ResponseEntityExcept..

skill/Java.Kotlin 2023.01.31

git 생성, intelliJ Project 생성 후 연동

1. git hub에서 repository 추가 New > Create a new repository 에서 Repository name 추가 후 'Create repository' 버튼 클릭 2. IntelliJ Project 생성 Welcome to IntelliJ IDEA > New Project (기본 : Spring , Gradle, log4j, jpa, mysql 연동) 좌측 Spring Initializr 클릭 > - Name : project 명 (편하게 repository 명과 동일) - Location 지정 : ~/path/project 명 - Type : Gradle-Groovy - Group : com.test.api (package명) - Artifact: project 명 - Pa..

skill/Git 2023.01.30

Gradle sync failed: No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.2 was found Error

-- gradle build error A problem occurred configuring root project 'test-project'. > Could not resolve all files for configuration ':classpath'. > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.2. Required by: project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.2 -- gralde sync Gradle sync failed: No matching variant of org.springframework.boo..

skill/Etc 2023.01.30

java -jar 서버 실행 FileNotFoundException 처리

서버 jar로 띄울 때 FileNotFoundException 에러 java -jar xxxxxx.jar -- exception cannot be resolved to absolute file path because it does not reside in the file system: jar: -- 원래 소스 (오류 발생) pom.xml file-path: classpath:xml/ -- java @Autowired private ResourceLoader resourceLoader; @Value("${file-path:''}") private String filePath; void reader() { resourceLoader.getResource(filePath + "test.xml").getFile..

카테고리 없음 2023.01.25

prometheus 설치 후 실행 시 에러(cannot execute binary file)

tar xvfz prometheus-*.tar.gz cd prometheus-* ./prometheus -bash: ./prometheus: cannot execute binary file OS에 맞는 버전을 재 설치 https://prometheus.io/download/ Download | Prometheus An open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach. prometheus.io Mac에서 linux 파일을 다운로드 받아서 실행 했더니, 에러 발생

카테고리 없음 2023.01.18