title: Swagger UI does not list any of the controller/end points though I am able to see the json under v2/api-docs endpoint
body: <p>I am not able to get my Swagger UI to work with my project. Swagger UI comes up fine but it does not list any of my REST controllers.</p>
  
  <p>I am using SPRING 4.2.6.RELEASE and Swagger 2.5.0 . My rest services are deployed to Tomcat 7.0.54 .</p>
  
  <p>When Tomcat 7.0.54 comes up, it is able to fetch the swagger end points.
  I am able to hit the endpoint v2/api-docs that fetches the json messages.
  I am also able to hit the swagger-ui but I dont see any controllers listed.
  The dropdowns are empty, as below</p>
  
  <p><a href="https://i.stack.imgur.com/GMsax.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GMsax.png" alt="enter image description here"></a></p>
  
  <p>**The issue I am facing currently is that </p>
  
  <ol>
  <li>I am not able to fetch the /swagger-resources/configuration/ui, when I launch the swagger UI I get 404 (Not Found) errror while the UI is trying to fetch /swagger-resources/configuration/ui . I have setup resource handlers for swagger-resources, but that does not seem to help. Can you please let me know what could be missing?</li>
  <li>Should I be seeing resources folder under META-INF in my expanded WAR? Should there be any springfox related files/folder inside META-INF? 
  **</li>
  </ol>
  
  <p><strong>Maven dependency for Swagger</strong>
          <br>
              
              io.springfox
              springfox-swagger2
              2.5.0
          <br>
          
              io.springfox
              springfox-swagger-ui
              2.5.0
          </p>
  
  <p><strong>Below is my SwaggerCongifuration</strong></p>
  
  <pre><code>@EnableSwagger2
  public class SwaggerConfiguration {
  
  @Bean
  public Docket api() {
      List&lt;SecurityContext&gt; security = new ArrayList&lt;SecurityContext&gt;();
      security.add(securityContext());
      return new Docket(DocumentationType.SWAGGER_2)
              .select()
              .apis(RequestHandlerSelectors.any())
              .paths(PathSelectors.any())
              .build()
              .pathMapping("/").securityContexts(security);
  }
  
  private SecurityContext securityContext() {
      return SecurityContext.builder()
              .forPaths(PathSelectors.regex("/"))
              .build();
   }
  }
  </code></pre>
  
  <p><strong>Below is my WebConfig.xml</strong></p>
  
  <pre><code>@EnableWebMvc
  @Configuration
  @Import(SwaggerConfiguration.class)
  @ComponentScan("com.bank.direct.services")
  
  public class WebConfig extends WebMvcConfigurerAdapter {
  
  
  @Override
  public void configureMessageConverters(List&lt;HttpMessageConverter&lt;?&gt;&gt; pConverters) {
      pConverters.add(RestUtils.getJSONMessageConverter());
  }
  
  
  @Override
  public void addResourceHandlers(ResourceHandlerRegistry registry) {
      registry.addResourceHandler("swagger-ui.html")
      .addResourceLocations("classpath:/META-INF/resources/");
  
      registry.addResourceHandler("/webjars/**")
      .addResourceLocations("classpath:/META-INF/resources/webjars/");
  }
  
  }
  </code></pre>
  
  <p><strong>Below is the SecurityCongif.xml</strong></p>
  
  <pre><code>@EnableWebSecurity
  @EnableGlobalMethodSecurity(prePostEnabled = true)
  @Configuration
  public class SecurityConfig extends WebSecurityConfigurerAdapter {
  
  
  @Autowired
  private AuthenticationService _authenticationService;
  
  
  @Autowired
  public void globalUserDetails(AuthenticationManagerBuilder pAuth) throws Exception {
  
      pAuth.userDetailsService(_authenticationService);
  }
  
  
  @Override
  protected void configure(HttpSecurity pHttp) throws Exception {
  
      // Enable HTTP caching
      pHttp.headers().cacheControl().disable();
  
      // Configure security
      pHttp.httpBasic()
  
      // -- Allow only authenticated request
      .and()
      .authorizeRequests()
      .anyRequest().authenticated()
  
      // -- Logout configuration
      .and()
      .logout()
      .logoutUrl("/rest/users/logout/")
      .deleteCookies("XSRF-TOKEN")
      .logoutSuccessUrl("/static/index.html")
      .invalidateHttpSession(true)
  
      // -- CSRF configuration
      .and()
      .csrf().csrfTokenRepository(csrfTokenRepository())
      .and()
      .addFilterAfter(csrfHeaderFilter(), SessionManagementFilter.class);
  
  }
  
  
  private Filter csrfHeaderFilter() {
  
      return new OncePerRequestFilter() {
  
          @Override
          protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
  
              CsrfToken csrf = (CsrfToken) request.getAttribute(CsrfToken.class.getName());
              if (csrf != null) {
                  Cookie cookie = WebUtils.getCookie(request, "XSRF-TOKEN");
                  String token = csrf.getToken();
                  if (cookie == null || token != null &amp;&amp; !token.equals(cookie.getValue())) {
                      cookie = new Cookie("XSRF-TOKEN", token);
                      cookie.setPath("/");
                      response.addCookie(cookie);
                  }
              }
              filterChain.doFilter(request, response);
          }
      };
  }
  
  
  private CsrfTokenRepository csrfTokenRepository() {
      HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
      repository.setHeaderName("X-XSRF-TOKEN");
      return repository;
  }
  </code></pre>
  
  <p>Rest Controller class as below</p>
  
  <pre><code>@RestController
  @RequestMapping(value = "/vehicles", produces =     MediaType.APPLICATION_JSON_UTF8_VALUE)
  public class VehicleResource extends Resource {
  
  @Autowired
  private IVehicleService _vehicleService;
  
  @RequestMapping(value = "/brands", method = RequestMethod.GET)
  public APIResponseEntity getBrands(WebRequest pWebRequest) {
  
      IUser user = getUser(pWebRequest);
      BrandCriteria criteria = new BrandCriteria();
      criteria.setLanguageCode(user.getLanguageCode());
  
      List&lt;Brand&gt; res = _vehicleService.getBrands(user, criteria);
  
      return newResponseOK(res);
  }
  
  @RequestMapping(value = "/brands/{brand_code}", method = RequestMethod.GET)
  public APIResponseEntity getBrand(WebRequest pWebRequest, @PathVariable("brand_code") String pBrandCode) {
  
      IUser user = getUser(pWebRequest);
      BrandCriteria criteria = new BrandCriteria();
      criteria.setLanguageCode(user.getLanguageCode());
      criteria.setBrandCode(pBrandCode);
      List&lt;Brand&gt; res = _vehicleService.getBrands(user, criteria);
      return newResponseOK(res);
   }
  }   
  </code></pre>