Inferred type 'S' for type parameter 'S' is not within its bound; should implement 'org.apache.catalina.User' 에러 해결하기

2025. 7. 9. 01:12·🕵️에러 해결사

1. 에러 상황

새롭게 프로젝트를 시작하면서 회원가입 로직을 구축하던 중, 다음과 같은 에러를 마주했다.

Inferred type 'S' for type parameter 'S' is not within its bound; should implement 'org.apache.catalina.User'

 

2. 에러 원인

spring에서 'User'라는 이름을 쓰다보면 자주 import오류가 발생한다.

JpaRepository<User, Long>에 들어간 User 타입이
내가 만든 User가 아니라
org.apache.catalina.User로 잘못 인식되어서 발생하는 문제이다.

(보통 Inferred type 'S' for type parameter 'S' is not within its bound; should~~원인은 코드 상에서 매개변수 명이 일치하지 않거나 import가 일치하지 않는 경우가 많은 것 같다)

 

해당 코드가 있는 UserSerivce에는 import org.apache.catalina.User가 없는데, 어디에 문제가 있는걸까?

Ctrl+Shift+F로 확인해보자.

 바로 UserRepository에서

import org.apache.catalina.User;

를 쓰고 있었던 것이다.

 

3. 에러 해결

해당 import를 지우고 내가 만든 경로의 User를 import해주었더니 에러가 말끔히 해결되었다!

'🕵️에러 해결사' 카테고리의 다른 글

Windows에서 Python 파일 경로 오류 해결하기: 올바른 경로 입력 방법 총정리  (0) 2025.03.11
"detail": "Given token not valid for any token type" 토큰 인증 오류 해결  (0) 2025.02.19
[Error]Id returned 1 exits status 에러 해결하기 (Dev C++)  (0) 2025.02.12
Spring Boot 프로젝트 실행 오류: Execution failed for task 해결 하기  (0) 2025.02.04
Spring Boot 프로젝트 실행 오류: Could not resolve all dependencies 해결하기  (0) 2025.02.04
'🕵️에러 해결사' 카테고리의 다른 글
  • Windows에서 Python 파일 경로 오류 해결하기: 올바른 경로 입력 방법 총정리
  • "detail": "Given token not valid for any token type" 토큰 인증 오류 해결
  • [Error]Id returned 1 exits status 에러 해결하기 (Dev C++)
  • Spring Boot 프로젝트 실행 오류: Execution failed for task 해결 하기
고딩코난
고딩코난
godingconan 님의 블로그 입니다.
  • 고딩코난
    코딩의 고난
    고딩코난
  • 전체
    오늘
    어제
    • 분류 전체보기 (16)
      • 🔰프레임워크 (0)
        • 🧩Spring (0)
        • 🥭Django (0)
      • 📓프로그래밍 언어 (0)
        • 🍵Java (0)
        • 🐍Python (0)
      • 🖥️CS (0)
        • 분산 시스템 (0)
      • 🔓알고리즘 (2)
        • 🌿백준 (2)
      • 🎞️프로젝트 (0)
      • 💸도전! 수익 창출 (0)
      • 🔖Lesson Learned (2)
      • 🕵️에러 해결사 (7)
      • 🌐Web (1)
      • 🔧Git&Github (2)
      • 🛡️Cloud (2)
        • 📡AWS (1)
        • NCP (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    spring 프로젝트
    알고리즘
    합격
    UDP
    백준
    C++
    TCP
    프로토콜
    네트워크
    종료 에러
    프로젝트 생성
    꿀팁
    IP
    버전 오류
    Spring
    1764
    정보처리기사 필기
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
고딩코난
Inferred type 'S' for type parameter 'S' is not within its bound; should implement 'org.apache.catalina.User' 에러 해결하기
상단으로

티스토리툴바