jboss5.1
报错信息如下
17:18:10,987 ERROR [DispatcherServlet] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'communicationController' bean method
public int site.lbt.controller.CommunicationController.repeatChatRequest(site.lbt.bean.Direction,site.lbt.bean.User)
to {[],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'communicationController' bean method
public boolean site.lbt.controller.CommunicationController.sendFollow(site.lbt.bean.Follow,site.lbt.bean.User) mapped.
看样子说是这个controller下repeatChatRequest这个方法和sendFollow方法map重复了,但是这2个方法对应的url明显不同为啥会重复,而且不止这2个方法,同一个controller下个各个方法都是一样的问题,但是其他controller则没有问题
顺带附上这个controller和这2个方法的声明部分
@Controller @SessionAttributes("user") public class CommunicationController
@RequestMapping(method = RequestMethod.POST) @ResponseBody public boolean sendFollow(Follow follow, @ModelAttribute("user") User user)
@RequestMapping(method = RequestMethod.POST) @ResponseBody public int repeatChatRequest(Direction direction, @ModelAttribute("user") User user)
RequestMapping注解中没看到你的url信息
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。