본문 바로가기
카테고리 없음

Method threw 'org.springframework.beans.factory.BeanCreationException' exception.

by 개발짜 2022. 11. 26.

Method threw 'org.springframework.beans.factory.BeanCreationException' exception.

 

bean이 제대로 등록되지 않았다고 해서 detailMassage 보니까

 

Error creating bean with name 'handlerExceptionResolver' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed

 

내가 등록한 bean이 아니라 WebMvcAutoConfiguration.class 에서 bean 등록에 자꾸 실패한다.

 

그래서 test application 실행하는 클래스 위에 WebMvcAutoConfiguration.class 를 제외하도록 설정

@Configuration
@SpringBootApplication
@EnableAutoConfiguration(exclude = {WebMvcAutoConfiguration.class})
public class TestApplication {
	...
}

 

출처: 

https://wiki.terzeron.com/ko/Programming/Java/Spring_&_Maven/org_springframework_beans_factory_BeanCreationException_Error_creating_bean_with_name_handlerExceptionResolver_defined_in_class_path_resource_%EC%98%A4%EB%A5%98_%ED%95%B4%EA%B2%B0

댓글