title: Swagger routes return 404 on Spring Boot + Jersey
body: <p>I am trying to add Swagger into an existing spring boot application as described in <a href="http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api" rel="nofollow">this</a> tutorial.</p>
  
  <p>My main application class is as follows:</p>
  
  <pre><code>@SpringBootApplication
  @EnableAutoConfiguration
  public class Application {
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>Swagger configuration is:</p>
  
  <pre><code>@Configuration
  @EnableSwagger2
  public class SwaggerConfiguration {
      @Bean
      public Docket api() { 
          return new Docket(DocumentationType.SWAGGER_2)
         .select()
          .apis(RequestHandlerSelectors.any())
          .paths(PathSelectors.any())
          .build();                                           
      }
  }
  </code></pre>
  
  <p>I can see Spring apparently identifies Swagger and it's routes in startup log:</p>
  
  <pre><code>s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/v2/api-docs],methods=[GET],produces=[application/json || application/hal+json]}" onto public org.springframework.http.ResponseEntity&lt;springfox.documentation.spring.web.json.Json&gt; springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)
  s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/configuration/ui]}" onto org.springframework.http.ResponseEntity&lt;springfox.documentation.swagger.web.UiConfiguration&gt; springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
  s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/configuration/security]}" onto org.springframework.http.ResponseEntity&lt;springfox.documentation.swagger.web.SecurityConfiguration&gt; springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
  s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources]}" onto org.springframework.http.ResponseEntity&lt;java.util.List&lt;springfox.documentation.swagger.web.SwaggerResource&gt;&gt; springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
  </code></pre>
  
  <p>but when trying to access <code>http://localhost:8080/v2/api-docs</code>, I get a plain 404 as response.</p>
  
  <p>All the similar issues I could find online refer to people not using Spring Boot and having to manually map resources (also described in the same tutorial link), but this wouldn't be my case.</p>
  
  <p>Any ideas how to fix it or - at least - where to proceed investigation?</p>