1

I created a basic spring boot web application

@SpringBootApplication
public class ScanApplication {
    public static void main(String[] args) {
        SpringApplication.run(ScanApplication.class, args);
    }
}



@RequestMapping(value = "/rest")
@RestController
public class MemberController {

    @GetMapping(value = "/users/{memberId}/scan")
    public ResponseEntity<Void> getCardId(@PathVariable("memberId") Long memberId) 
    ...
    }
}

In the browser, if i call

http://localhost:8080/rest/users/1/scan

I get this message

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Sep 27 16:46:37 EDT 2016 There was an unexpected error (type=Not Found, status=404). No message available

Don't understand why i get this message.

robert trudel
  • 5,283
  • 17
  • 72
  • 124
  • 2
    What packages are `ScanApplication` and `MemberController` in? – Andy Wilkinson Sep 27 '16 at 20:58
  • 1
    Notice: Make sure that your main class is in a root package above other classes. When you run a Spring Boot Application, (i.e. a class annotated with @SpringBootApplication), Spring will only scan the classes below your main class package. see also: http://stackoverflow.com/a/39017839/6372139 – Daniel Bubenheim Sep 27 '16 at 21:11
  • What are the packages of ScanApplication and MemberController ? – reos Sep 27 '16 at 21:35
  • + make sure you don't have a value defined for server.contextPath in your application.properties, which would add a context root to your expected url. – alexbt Sep 28 '16 at 00:06

0 Answers0