전체 글
-
STOMP 메시지 전송 시 security context holder에서 유저 정보를 가져올 수 없는 error트러블슈팅 2024. 8. 16. 17:48
문제Jul 24 17:13:51 ip-172-31-44-203 web[1195047]: ----------------- stomp command : SENDJul 24 17:13:51 ip-172-31-44-203 web[1195047]: ----------------- authentication : kimtahwn@naver.comJul 24 17:13:51 ip-172-31-44-203 web[1195047]: 2024-07-24T17:13:51.882+09:00 ERROR 1195047 --- [nboundChannel-6] .WebSocketAnnotationMethodMessageHandler : Unhandled exception from message handler methodJul 24 1..
-
STOMP 연결, 해제 시 header 값 Error트러블슈팅 2024. 8. 15. 23:38
문제ChatService에서 @EventListener 를 통해 프론트에서 header 에 같이 넣어준 chatRoomId와 socket session id의 값을 제대로 가져오지 못 하는 문제가 발생원인기존 코드 @EventListener public void handleSessionConnect(SessionConnectEvent event) { MessageHeaderAccessor accessor = NativeMessageHeaderAccessor.getAccessor(event.getMessage(), SimpMessageHeaderAccessor.class); GenericMessage generic = (GenericMessage) accessor.get..
-
WebSocket 연결 시, JWT Token Error트러블슈팅 2024. 8. 15. 20:29
문제다른 요청에 대해서는 header의 token을 정상적으로 가져오지만 Web Socket의 요청에서 계속 Spring Security Context 에서 사용자의 정보를 가져올 때, 에러가 발생했다.원인정상적인 요청Jul 23 09:24:38 ip-172-31-44-203 web[1099434]: token : Bearer aaaaaaaaabbbbbbbbbbbccccccccwebsocket 의 요청Jul 23 09:22:29 ip-172-31-44-203 web[1099434]: token : nullhttp와 WebSocket의 Security chain, config는 완전히 독립적이다.기존 AuthenticationProvider는 Websocket Authentication에 관여하지 않는다...
-
Redis protected mode Error트러블슈팅 2024. 8. 15. 20:22
문제Jul 11 20:25:59 ip-172-31-44-203 web[526050]: 2024-07-11T20:25:59.368Z ERROR 526050 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exceptionJul 11 20:25:59 ip-172-31-44-203 web[526050]: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to RedisJul 11 20:25:59 ip-172..
-
spring security oauth2.0 kakao error트러블슈팅 2024. 8. 15. 20:11
문제카카오 로그인 시도시 KOE006 에러가 발생했다.원인redirect-uri 의 문제kakao-develop에 등록한 redirect-uri 와 배포한 서버의 redirect-uri 가 달라서 발생한 문제였다.해결application-oauth.yml에서 redirect-uri 수정또한 spring security oauth2 에서 지정한 redirect-uri 의 형식은/login/oauth2/code/이므로 기존의 uri에서/login/oauth2/code/kakao 로 수정해주었다.
-
spring boot 3 버전 이상에서 swagger 사용하기Spring 2024. 7. 2. 00:16
build.gradle에 아래 문구를 작성하여 의존성을 추가해주면 swagger를 사용할 수 있습니다.//swaggerimplementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' http://localhost:8080/swagger-ui/index.html 에서 확인할 수 있습니다. Spring Security를 사용 중이라면, import org.springframework.context.annotation.Configuration;import org.springframework.security.config.annotation.web.builders.HttpSecurity;import org.springframework.securit..
-
프로그래머스 - 대충 만든 자판알고리즘 2024. 5. 7. 19:08
class Solution { public int[] solution(String[] keymap, String[] targets) { int[] answer = new int[targets.length]; for(int i = 0; i 각 targes에서 각 문자열의 문자를 구하고, keymap에서 배열의 원소마다 비교하여 charAt을 이용해 최소 클릭 횟수를 구하여 sum에 더해 키를 누른 횟수를 구했습니다. 만약 문자가 keymap에 포함되어 있지않다면 -1를 반환해야하므로, boolean 타입을 이용하여 체크해 이를 확인했습니다.