본문 바로가기

분류 전체보기110

[Spring Boot] AWS S3 버킷 연결 에러 Error creating bean with name 'org.springframework.cloud.aws.core.env.ResourceIdResolver.BEAN_NAME' 위와 같은 에러를 맞이했을 땐 applicaetion.properties에 아래와 같은 코드를 추가해주면 된다. cloud.aws.stack.auto=false 2023. 8. 7.
[Spring Boot] HttpMediaTypeNotAcceptableException 에러 해결 REST API 테스트를 하던 도중 org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation 이와 같은 에러가 발생했다. @GetMapping("/post/{id}") public MZ_BoardResponse getPost(@PathVariable Long id){ return mz_boardService.getBoard(id); } 컨트롤러에선 아무 문제가 없어보였는데, MZ_BoardResponse 클래스에 문제가 있나 확인해보니, @Data 어노테이션을 깜빡하고 추가해주지 않았다. @Data 말고 @Getter를 추가해줘도 위의 문제를 해결할 수 있다. 2023. 7. 31.
[Spring Boot] mysql 데이터베이스 연결하기 1. dependency 추가 - springboot 버전이 2.x.x 인 경우는 runtimeOnly 'mysql:mysql-connector-java' - 3.x.x 이상부터는 runtimeOnly 'com.mysql:mysql-connector-j' 2. 데이터베이스 생성 나는 Command Line Client를 통해서 미리 데이터 베이스와 유저 생성했다. 3. application.properties에 데이터베이스 정보 입력 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/데이터베이스?useSSL=false&allowPublicKeyRetrieva.. 2023. 7. 30.
[Spring Boot] MySQL Access denied for user java.sql.SQLException: Access denied for user 'likelion'@'localhost' (using password: YES) 이런 오류가 발생했을 때는 Bitnami WANP Stack이 설치되어 있는지 확인하고 이 앱을 실행하면 해결 된다. 2023. 7. 6.
[Spring Boot] Could not find com.mysql:mysql-connector-j 오류 오류 com.mysql:mysql-connector-j 를 찾을 수 없음 build.gradle - springboot version 3.x.x는 connector-j만 지원 -> 버전을 낮추고, connector-java로 변경 빌드 성공 데이터베이스 생성하기 2023. 5. 29.
[JAVA] 10진수를 2진수로 변환하기 Integer.toString(int i, int radix) (10진수를 n진수 문자열로 변환) Integer 클래스의 메소드로 첫 번째 인수 i를 두 번째 인수 radix에서 지정한 진수의 문자열 표현으로 반환한다. 만약 radix가 Character.MIN_RADIX보다 작거나 Character.MAX_RADIS보다 크면 raidx = 10이 된다. i : n진수의 문자열로 변환할 정수 radix : 문자열 표현에서 사용할 진수 반환값 : 지정된 진수에서의 문자열 표 public static String toString(int i, int radix) { if (radix Character.MAX_RADIX) radix = 10; /* Us.. 2023. 4. 3.