把项目的spring版本从3.0升级到3.2之后,其中一个controller报奇怪的错误

water_j 发布于 2013/09/13 17:50
阅读 1K+
收藏 0

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)

加载中
0
java_小白
java_小白
RequestMapping注解中没看到你的url信息
返回顶部
顶部