我有這個映射/列出POST請求的「創建」方法。我做了一個重載的方法「createEmpty()」來嘗試一些東西,但後來被刪除,因爲它爲模糊映射拋出了org.springframework.beans.factory.BeanCreationException。Spring MVC 3:爲不存在的方法找到的模糊映射
問題是,我刪除了所說的方法後,我仍然得到異常。
@Controller
public class ListsController {
@RequestMapping(value = "/lists", method = RequestMethod.POST)
public @ResponseBody List create(@RequestBody List list) {
return list;
}
信息:開發應用服務器現在運行 可能04 2014年下午4時21分34秒com.google.apphosting.utils.jetty.JettyLogger警告 警告:/:javax.servlet.UnavailableException :org.springframework.beans.factory.BeanCreationException:使用名稱'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0'創建bean時出錯:bean初始化失敗;嵌套異常是java.lang.IllegalStateException:找到模糊映射。無法映射'listsController'bean方法 public tacs.tp.list_sharer.domain.List tacs.tp.list_sharer.web.ListsController.createEmpty() to {[/ lists],methods = [POST],params = [], headers = [],consumes = [],produce = [],custom = []}:已經有'listsController'bean方法 public tacs.tp.list_sharer.domain.List tacs.tp.list_sharer.web.ListsController。創建(tacs.tp.list_sharer.domain.List)映射。 may 04,2014 4:21:34 PM com.google.apphosting.utils.jetty.JettyLogger警告 警告:/:javax.servlet.UnavailableException:org.springframework.beans.factory.BeanCreationException:創建名爲' org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0':bean初始化失敗;嵌套異常是java.lang.IllegalStateException:找到模糊映射。無法映射'listsController'bean方法 public tacs.tp.list_sharer.domain.List tacs.tp.list_sharer.web.ListsController.createEmpty() to {[/ lists],methods = [POST],params = [], headers = [],consumes = [],produce = [],custom = []}:已經有'listsController'bean方法 public tacs.tp.list_sharer.domain.List tacs.tp.list_sharer.web.ListsController。創建(tacs.tp.list_sharer.domain.List)映射。
似乎createEmpty()被緩存的地方......
在你的ListController中是否有'createEmpty'方法? – geoand
當然不是。 mvn clean install修復了這個問題。 – Vallo