Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(name="/quiz/questions/{quizId}", method=RequestMethod.GET)
- public ResponseEntity<QuizQuestion> questions(@PathVariable String quizId) {
- QuizQuestion question = this.quizService.fetchQuestion(quizId);
- if (question == null) {
- return new ResponseEntity<QuizQuestion>(HttpStatus.NOT_FOUND);
- }
- return new ResponseEntity<QuizQuestion>(question, HttpStatus.OK);
- }
- @RequestMapping(name="/quiz/score/{id}", method=RequestMethod.GET)
- public Score getScore(@PathVariable("id") String quizId) {
- return this.quizService.getScore(quizId);
- }
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map '/myapplication' method
- public com.project.myapplication.Score com.project.myapplication.QuizController.getScore(java.lang.String)
- to {[],methods=[GET]}: There is already '/myapplication' bean method
- public org.springframework.http.ResponseEntity<com.project.myapplication.QuizQuestion> com.project.myapplication.QuizController.questions(java.lang.String) mapped.
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
- . . . . . . . .. .
- Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map '/myapplication' method
- public com.project.myapplication.Score com.project.myapplication.QuizController.getScore(java.lang.String)
- to {[],methods=[GET]}: There is already '/myapplication' bean method
- public org.springframework.http.ResponseEntity<com.project.myapplication.QuizQuestion> com.project.myapplication.QuizController.questions(java.lang.String) mapped.
- at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:576) ~[spring-webmvc-4.3.12.RELEASE.jar:4.3.12.RELEASE]
- at
- @RequestMapping(name="/quiz/score/{id}", method=RequestMethod.GET)
- public Score getScore(@PathVariable("id") String quizId) {
- return this.quizService.getScore(quizId);
- }
- @RequestMapping(value="/quiz/score/{id}", method=RequestMethod.GET)
- public Score getScore(@PathVariable("id") String quizId) {
- return this.quizService.getScore(quizId);
- }
Add Comment
Please, Sign In to add comment