기혁씨의 삽질표류기

[에러]BeanCreationException:RequestMappingHandlerMapping

각시탈코더 2022. 8. 17. 09:53

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'testController' method 
public java.lang.String com.devcamp.eztour.controller.test.TestController.testMapping()
to {[/test],methods=[GET]}: There is already 'simpleRestController' bean method

 

*Invocation: 요청

 

오류 메세지:매핑이 중복되었다.

오류원인: mapping이 중복되어 'testController'를 mapping 할 수 없다. 이미 'simpleRestController'가 매핑되어있다.

오류해결과정: testController와 경로가 중복되는 controller를 찾았다. 오류 메시지에 있는 simpleRestController가 testController의 경로와 중복되는 걸 확인할 수 있었다.