SpringSecurity1 🚨[JPA] LazyInitializationException: failed to lazily initialize a collection of role 1. 문제 상황Spring Boot + JPA 환경에서 온도 조회 API를 개발하던 중 아래와 같은 예외가 발생했다.failed to lazily initialize a collection of role: goorm.ddok.member.domain.User.positions: could not initialize proxy - no Session 즉, `User` 엔티티에서 연관된 컬렉션(positions)을 접근하려고 했는데 Hibernate 세션이 이미 닫혀 있어서 Lazy 로딩을 수행하지 못한 상황이다. --- 2. 원인 분석내 서비스 코드는 대략 이런 구조였다.public TemperatureMeResponse getMyTemperature(CustomUserDetails currentUser).. 2025. 9. 12. 이전 1 다음