본문 바로가기

Spring Boot

(9)
[Spring Boot] java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 에러 에러 JPA, MySQL 사용 결과 에러 발생 java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 해결 1. MySQL 문법이 잘못 쓰인게 있는지 확인 2. 문법 잘못 쓰인게 없을 시, MySQL 예약어 사용 확인(Order 등등) 3. MySQL 예약어를 사용중일 경우 예약어 사이에 \" 추가 ex. \"(예약어)\" 변경 전 변경 후
[Spring Boot] Inferred type 'S' for type parameter 'S' is not within its bound; should extend 에러 Inferred type 'S' for type parameter 'S' is not within its bound; should extend 및 error: method save in interface CrudRepository cannot be applied to given types 에러 해결 JPA JpaRepository 매개변수 확인, 인터페이스 명 일치 확인
[Spring Boot] Protocol handler start failed 에러 에러 Protocol handler start failed 해결 포트 충돌 에러 1. cmd 창 실행 후 netstat -ano 입력 2. 해당 포트 찾은 PID 찾은 후 3. taskkill /F /PID (PID 번호)로 프로세스 종료
[Spring Boot, React] 405 (Not Allowed) 에러 1. GET POST 요청 일치하는지 확인 Spring Boot에서 GET 요청만 받는데 POST는 보내지 않는지 POST만 요청만 받는데 GET 보내지 않는지 확인 2. 프론트 -> 백 매핑이 잘 되었는지 확인(URL 일치여부 확인) Spring Boot 서버포트 및 서버 어드레스 React 베이스 URL 일치여부 확인
[Spring Boot] Nginx protocol handler start failed 1. Nginx에서 jar파일 실행시 protocol handler start failed 발생 application.properties에서 server.address 변경 server.address=0.0.0.0
[Spring Boot] Base64 이미지 관리 Spring Boot, MySQL, React 1. 컨트롤러 1-1 MultipartFile을 이용해서 이미지 받아오기 1-2 받은 이미지 Base64로 인코딩 후 String에 저장 1-3 데이터 베이스 저장을 위해 서비스로 전달 @PostMapping() public ResponseEntity save(MultipartFile image) throws IOException { String photoImg = null; if (image != null) { Base64.Encoder encoder = Base64.getEncoder(); byte[] photoEncode = encoder.encode(image.getBytes()); photoImg = new String(photoEncode, "UT..
[Spring Boot] Unsupported Media Type 415 파일업로드시 Unsupported Media Type 415 에러 -- 에러 해결 파일 업로드시 파라미터로 RequestBody 사용 불가 위와 같이 변경
[Spring Boot] Can not issue data manipulation statements with executeQuery() 오류 JPA update, delete 사용시 @Transactional @Modifying 어노테이션 추가 @Transactional @Modifying @Query(value = "delete user where user_id = :userId", nativeQuery = true) void deleteId(Long userId);