강의

멘토링

로드맵

Inflearn brand logo image

인프런 커뮤니티 질문&답변

문주영님의 프로필 이미지
문주영

작성한 질문수

[섹션10] 빈 스코프 - request 예제 만들기 : 콘솔창에서 tomcat 포트번호 안보입니다 어떻게 해야할까요

작성

·

23

0

package hello.core;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class CoreApplication {

	public static void main(String[] args) {
		SpringApplication.run(CoreApplication.class, args);
	}

}

build.gradle에 web 도 추가해줬고, 외부라이브러리에 들어온것도 확인했습니다.
정상실행은 되는데 콘솔창에 tomcat 포트 번호가 왜 안나올까요?

 

2025-03-11T20:28:43.171+09:00 INFO 31192 --- [ main] hello.core.CoreApplication : Starting CoreApplication using Java 17.0.12 with PID 31192 (C:\Users\user\Desktop\study\core\build\classes\java\main started by user in C:\Users\user\Desktop\study\core)

2025-03-11T20:28:43.179+09:00 INFO 31192 --- [ main] hello.core.CoreApplication : No active profile set, falling back to 1 default profile: "default"

2025-03-11T20:28:44.874+09:00 WARN 31192 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'memoryMemberRepository' defined in class path resource [hello/core/AutoAppConfig.class]: Cannot register bean definition [Root bean: class=null; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=autoAppConfig; factoryMethodName=memberRepository; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [hello/core/AutoAppConfig.class]] for bean 'memoryMemberRepository' since there is already [Generic bean: class=hello.core.member.MemoryMemberRepository; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null; defined in file [C:\Users\user\Desktop\study\core\build\classes\java\main\hello\core\member\MemoryMemberRepository.class]] bound.

2025-03-11T20:28:44.898+09:00 INFO 31192 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.

2025-03-11T20:28:44.986+09:00 ERROR 31192 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

***************************

APPLICATION FAILED TO START

***************************

Description:

The bean 'memoryMemberRepository', defined in class path resource [hello/core/AutoAppConfig.class], could not be registered. A bean with that name has already been defined in file [C:\Users\user\Desktop\study\core\build\classes\java\main\hello\core\member\MemoryMemberRepository.class] and overriding is disabled.

Action:

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

답변 1

문주영님의 프로필 이미지
문주영

작성한 질문수

질문하기