java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'helloController2' method 
public java.lang.String com.shiyaxin.springboot.controller.HelloController2.test()
to {GET /hello/show}: There is already 'helloController' bean method
public java.lang.String com.shiyaxin.springboot.controller.HelloController.test() mapped.
. lang。IllegalStateException:模糊映射。无法映射“helloController2”方法
公共. lang。字符串com.shiyaxin.springboot.controller.HelloController2.test ()
to {GET /hello/show}:已经有了'helloController' bean方法
公共. lang。字符串com.shiyaxin.springboot.controller.HelloController.test()映射。

错误原因是:(模糊映射,spring也识别不了去哪个里)
两个controller的名字都是hello/show
解决办法:
给其中一个controller重名的请求路径换个名字

Logo

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐