</pre><pre name="code" class="java">java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'helloWorldController2' bean method
public java.lang.String cn.chapter2.controller.HelloWorldController2.test()
to {[/hello2],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already '/hello2' bean method
public java.lang.String cn.chapter2.controller.HelloWorldController2.test() mapped.
错误代码如上
经查原因为:重复定义bean,在xml定义了bean,又在action你用注解controller定义了,导致出错,干掉xml的bean解决了。