Spring

Spring

org.hibernate.PersistentObjectException: detached entity passed to persist 에러

에러 문구 org.hibernate.PersistentObjectException: detached entity passed to persist: com.chs.cafeapp.auth.user.entity.User javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: com.chs.cafeapp.auth.user.entity.User at app//org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154) at app//org.hibernate.interna..

Spring

[Spring Security] 권한 인증 관련 에러(401, 403) CustomException처리로 보여주기

하고싶었던 개인프로젝트를 진행하면서 정리하고싶고 마주한 어려움도 많았지만 우선 권한 인증 에러부분 같은 경우 이전에도 CustomException으로 동일하게 처리하고싶었기 때문에 이것 먼저 정리해둔다. 문제 상황 -> 이미 인텔리제이 종료후 유효하지않은 token 값으로 접근한 경우 -> 사용자 없을 때 CustomException 처리 문구 문제 > 로그인이 안된 상태인데 401에러가 아닌 403에러를 뱉어내고, 내내 CustomException으로 동일성을 주었던것이 권한 인증에 관련해서 일관성이 없어서 마음에 안들었다. 해결 방법 JwtAccessDeniedHandler @Component public class JwtAccessDeniedHandler implements AccessDeniedH..

Spring

window 환경에서 sdkman 설치하기

참조한 블로그 : https://dalinaum.github.io/java/2021/03/07/multiple-jdks-2.html 윈도우에 여러 자바 설치하기 맥에 여러 자바 버전을 설치했었는데 이제 윈도우즈에서도 여러 자바 버전을 사용할 필요가 생겼다. (이게 다 코틀린 빌드 때문이다.) dalinaum.github.io Poweshell Powershell에서 해당 명령을 복사한후 붙여넣기 한다. Set-ExecutionPolicy RemoteSigned -scope CurrentUser iwr -useb get.scoop.sh | iex 그러면 " 실행정책을 변경하시겠습니까?" 라고 나오는데 그냥 A로 바꾸겠다고 하면된다. 그런 다음 scoop install zip을 한다. git bash cur..

Spring

spring boot version 3.x.x 사용시 swagger 사용이 불가한 상황 생김

spring boot version : 3.0.4 로 했다가 swagger-ui를 인식을 못하고 spring boot가 실행되지 않는 문제 발생 spring boot version : 2.7.4 로 downgrade해서 swagger-ui.index.html로 API document 사용했다.

three von
'Spring' 카테고리의 글 목록