JPA를 이 프로젝트에 적용하는 중에 정말 알 수 없는 오류가 났다.....!
VO를 엔티티로 변경하고 마이바티스를 JPA로 변경하면서 DAO를 삭제하고 리포지토리를 만들었다. 서버를 켰는데
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authProvider': Unsatisfied dependency expressed through field 'myUserDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myUserDetailsService': Unsatisfied dependency expressed through field 'memberDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.jam.client.member.dao.MemberDAO' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
ㅎㅎ
UnsatisfiedDependencyException는 의존성 주입을 할 수 없다는 오류인데 authProvider > myUserDetailsService > memberDao에 해당하는 타입의 빈이 스프링 컨텍스트 내에 존재하지 않다는 것이었따..
하지만 나는 AuthProvider와 MyUserDetailsService는 예전에 스프링 시큐리티 할 때 만들었다가 진작 삭제했던 것들이고 MemberDAO도 삭제했는데 이런 오류가 나다니
오류를 해결하기 위해 시도해본 방법
1 프로젝트 클린 = 실패
2 메이븐 업데이트 = 실패
3 재시작 = 실패
4 search로 찾기 = 없음
5 모든 파일 다 확인 = 없음
6 메타데이터 확인 = 없음
AuthProvider와 MyUserDetailsService가 스프링 시큐리티와 Jwt에 관련된 것들이니까 스프링 시큐리티 코드들 다 주석으로 변경하고 dependency도 삭제했는데 안되고
마지막에는 오기 생겨서 거의 모든 코드를 주석처리 했는데도 같은 오류가 났다.
결국 JPA는 다른 프로젝트에 적용하기로 했다..... 역시 기존 프로젝트를 변경하는 건 어렵구나
'프로젝트 > JAM' 카테고리의 다른 글
---- (0) | 2024.02.05 |
---|---|
---- (0) | 2024.02.05 |
-- (0) | 2023.12.04 |
[SpringMVC] Spring Security + JWT토큰 (1) | 2023.10.03 |
[Spring] Spring Security (0) | 2023.09.02 |