gpt4 book ai didi

java - Spring MVC 3 : Ambiguous mapping found for a non existing method

转载 作者:行者123 更新时间:2023-11-29 06:34:43 30 4
gpt4 key购买 nike

我有这个映射/列出 POST 请愿的“创建”方法。我创建了一个重载方法“createEmpty()”来尝试一些事情,但后来被删除,因为它抛出了一个用于模糊映射的 org.springframework.beans.factory.BeanCreationException。

问题是在我删除上述方法后,我仍然得到异常。

@Controller
public class ListsController {

@RequestMapping(value = "/lists", method = RequestMethod.POST)
public @ResponseBody List create(@RequestBody List list) {
return list;
}

INFO: Dev App Server is now running may 04, 2014 4:21:34 PM com.google.apphosting.utils.jetty.JettyLogger warn WARNING: /: javax.servlet.UnavailableException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'listsController' bean method public tacs.tp.list_sharer.domain.List tacs.tp.list_sharer.web.ListsController.createEmpty() to {[/lists],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'listsController' bean method public tacs.tp.list_sharer.domain.List tacs.tp.list_sharer.web.ListsController.create(tacs.tp.list_sharer.domain.List) mapped. may 04, 2014 4:21:34 PM com.google.apphosting.utils.jetty.JettyLogger warn WARNING: /: javax.servlet.UnavailableException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'listsController' bean method public tacs.tp.list_sharer.domain.List tacs.tp.list_sharer.web.ListsController.createEmpty() to {[/lists],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'listsController' bean method public tacs.tp.list_sharer.domain.List tacs.tp.list_sharer.web.ListsController.create(tacs.tp.list_sharer.domain.List) mapped.

似乎 createEmpty() 缓存在某处......

最佳答案

请尝试做:
1. 如果你使用的是eclipse - Project -> Clean.
2. 如果您使用的是 Maven,请尝试在部署之前清理和/或安装项目。



我看到您正在使用 Jetty,也许这些链接将有助于解决您的问题:
Cleaning up Jetty - Removing 'unnecessaries' things
Jetty runs old war altought mvn clean is run

关于java - Spring MVC 3 : Ambiguous mapping found for a non existing method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23460662/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com