Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource
2018-08-13 21:09
811 查看
出现问题=有很多,下面的是一种。有些人不小心造成的。 错误所在,上下的这两个方法,有没有发现请求路径都是一样的,虽然你跟的参数不一样,但是还是会报错,** 报出问题: 方法初始化失败,也就是springboot找不到应该请求哪个路径。 解决办法, 可以将其中的一个@GetMapping修改为 @RequestMapping即可解决异常. 亲测 @Autowired private SpecifacationService specifacationService; @GetMapping("/params") public ResponseEntity<List<SpecParam>> queryParamByCategoryId( @RequestParam(value = "gid", required = false) Long gid, @RequestParam(value = "cid", required = false) Long cid, @RequestParam(value = "searching", required = false) Boolean searching, @RequestParam(value = "generic", required = false) Boolean generic) { List<SpecParam> list = this.specifacationService.querySpecParams(gid, cid, searching, generic); if (list == null || list.size() == 0) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } return ResponseEntity.ok(list); } //查询组里面的参数信息 **@GetMapping("/params")** public ResponseEntity<List<SpecParam>> queryParamBygid(@RequestParam(value = "gid", defaultValue = "1") Long gid) { List<SpecParam> listParam = specifacationService.queryParamBygid(gid); if (CollectionUtils.isEmpty(listParam)) { return ResponseEntity.notFound().build(); } return ResponseEntity.ok(listParam); } 2018-8-13 记.阅读更多
相关文章推荐
- Error creating bean with name 'sqlSessionFactory' defined in class path resource
- Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
- Error creating bean with name 'dataSource' defined in class path resource
- Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]:
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
- Error creating bean with name 'UserManger' defined in class path resource [user/applicationContext.x
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
- Error creating bean with name 'entityManagerFactory' defined in class path resource
- 【解决】SpringMVC整合Shiro之 Error creating bean with name 'shiroFilter' defined in class path resource...
- Error creating bean with name 'mySessionFactory' defined in class path resource [applicationContext.xml]:
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
- Meavn 搭建项目遇到Error creating bean with name 'sessionFactory' defined in class path resource
- Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Initialization of bean faile
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
- Error creating bean with name 'userService' defined in class path resource [beans.xml]: Unsatisfied dependency expressed through
- Shiro配置错误之“Error creating bean with name 'securityManager' defined in class path resource”
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
- Error creating bean with name 'sqlSessionFactory' defined in class path resource