ssm注解方式实现启动tomcat报错

来源:互联网 发布:mac版的仙剑没有文字 编辑:程序博客网 时间:2024/06/03 09:26
</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 methodpublic java.lang.String cn.chapter2.controller.HelloWorldController2.test() mapped.


错误代码如上

经查原因为:重复定义bean,在xml定义了bean,又在action你用注解controller定义了,导致出错,干掉xml的bean解决了。

0 0