[SpringBoot] Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true 에러 해결

2022. 8. 14. 15:01·에러 해결
반응형

 

한이음 프로젝트의 변경사항이 생겨 프로젝트 이름과 경로를 변경하고 서버가 실행되나 테스트해봤는데 에러가 발생했다. 

***************************
APPLICATION FAILED TO START
***************************

Description: The bean 'boardRepository', defined in com.salmal.board.repository.BoardRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration, could not be registered. A bean with that name has already been defined in com.salmal.board.board.repository.BoardRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

 

별로 이쁘게 꾸며서 에러를 날려주는데 검색해보니 스프링부트 버전이 2.1로 올라가면서부터 오버라이딩 하는 기능을 멈추도록 바꾸었단다. 즉 다른 곳에서 이미 해당 bean을 생성해, 중복이 되어 문제가 되는 것 같다.

-참고-

 

build시 다음과 같은 에러가 납니다. - 인프런 | 질문 & 답변

APPLICATION FAILED TO STARTDescription:The bean 'holoman', defined in class path resource [me/izac/HolomanConfiguration.class], could not be registered....

www.inflearn.com

 

 

해결 방법은 다른 에러보다는 간단하다.

application.yml 파일에 아래 코드를 붙여넣어주면 된다.

spring:
  main:
    allow-bean-definition-overriding: true

 

반응형
저작자표시 비영리 변경금지 (새창열림)
'에러 해결' 카테고리의 다른 글
  • SpringBoot 3.X 인텔리제이 켜자마자 에러가 발생했을 때 해결 법
  • [SpringBoot] I/O error on GET request for ~ : Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
  • [SpringBoot] message.properties 파일에 한글이 아닌 외계어가 나올 경우 문제 해결
  • [SpringBoot] No message found under code 'hello' for locale 'null'. 에러 해결
데부한
데부한
어차피 할 거면 긍정적으로 하고 싶은 개발자
    반응형
  • 데부한
    동동이개발바닥
    데부한
  • 전체
    오늘
    어제
    • 분류 전체보기 (307)
      • 방통대 컴퓨터과학과 (27)
        • 잡담 (9)
        • 3학년1학기 (17)
      • 프로젝트 및 컨퍼런스 회고 (1)
        • 프로젝트 (4)
        • 한이음 프로젝트 (0)
        • 회고 (3)
      • 공부 (165)
        • Spring (37)
        • JPA (71)
        • 인프런 워밍업 클럽_BE (10)
        • Java (6)
        • React.js (27)
        • 넥사크로 (11)
        • 기타 (3)
      • 알고리즘 (85)
        • 알고리즘 유형 (10)
        • 알고리즘 풀이 (57)
        • SQL 풀이 (18)
      • 에러 해결 (13)
      • 잡담 (7)
        • 국비교육 (2)
        • 구매후기 (5)
        • 진짜 잡담 (0)
  • 블로그 메뉴

    • Github
    • Linkedin
    • 홈
    • 방명록
    • 글쓰기
    • 관리
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    프론트엔드
    react
    RESTful
    운영체제
    MSA
    SpringBoot를 이용한 RESTful Web Service 개발
    SQL
    전자정부프레임워크
    에러해결
    oracle
    개발자
    Java
    토비의스프링부트
    egov
    프로그래머스
    자바스크립트
    Spring
    QueryDSL
    넥사크로
    springboot
    스프링부트
    JPA
    코딩테스트
    알고리즘
    방통대
    토이프로젝트
    백준
    인프런
    기출문제
    IT
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
데부한
[SpringBoot] Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true 에러 해결
상단으로

티스토리툴바