title: swagger-ui.html page not working springboot
body: <p>I am migrating my project which is based on springMVC to spring boot. it is a multi-module project. I am unable to get the swagger-ui.html up. I have added dispatcher servlet as follows:</p>
  <pre><code>@Configuration
  public class DispatcherServletConfig {
  
  @Bean
  public DispatcherServlet dispatcherServlet() {
      return new DispatcherServlet();
  }
  
  @Bean
  public ServletRegistrationBean dispatcherServletRegistration() {
      ServletRegistrationBean registration = new 
    ServletRegistrationBean(dispatcherServlet(), &quot;/prefix1/*&quot;);
      registration.addUrlMappings(&quot;/admin/*&quot;);
      registration.addUrlMappings(&quot;/prefix2/*&quot;);
       registration.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
      return registration;
  }
  
  }
  private static final Set&lt;String&gt; DEFAULT_PRODUCES_AND_CONSUMES = 
            new HashSet&lt;String&gt;(Arrays.asList(&quot;application/json&quot;,
                &quot;application/xml&quot;));
  
  @Configuration
  @EnableSwagger2
  public class SwaggerConfig extends WebMvcConfigurationSupport {
  
  private static final Set&lt;String&gt; DEFAULT_PRODUCES_AND_CONSUMES = 
            new HashSet&lt;String&gt;(Arrays.asList(&quot;application/json&quot;,
                &quot;application/xml&quot;));
  
  @Bean
  public Docket api() {
      ParameterBuilder aParameterBuilder = new ParameterBuilder();
      aParameterBuilder.name(&quot;Authorization&quot;).modelRef(new ModelRef(&quot;string&quot;)).parameterType(&quot;header&quot;)
              .description(&quot;Authorization Header&quot;).required(true).build();
      List&lt;Parameter&gt; aParameters = new ArrayList&lt;&gt;();
      aParameters.add((Parameter) aParameterBuilder.build());
      return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())
              .paths(PathSelectors.any()).build().apiInfo(apiInfo()).globalOperationParameters(aParameters).produces(DEFAULT_PRODUCES_AND_CONSUMES);
  }
  
  private ApiInfo apiInfo() {
      Contact contact = new Contact(&quot;Pvt. Ltd.&quot;, &quot;&lt;url&gt;&quot;, &quot;support@email.com&quot;);
      return new ApiInfo(&quot;API&quot;, &quot;Information related to api exposed by system.&quot;, &quot;1.0&quot;,
              &quot;&lt;url&gt;&quot;,
              &quot;&lt;url&gt;&quot;, new ArrayList&lt;&gt;());
  }
  }
  </code></pre>
  <p>i have added the following dependencies in my pom.xml:</p>
  <pre><code> &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-excelant&lt;/artifactId&gt;
          &lt;version&gt;3.14&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
          &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
          &lt;version&gt;1.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.mail&lt;/groupId&gt;
          &lt;artifactId&gt;mail&lt;/artifactId&gt;
          &lt;version&gt;1.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.ibm.icu&lt;/groupId&gt;
          &lt;artifactId&gt;icu4j&lt;/artifactId&gt;
          &lt;version&gt;3.4.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
          &lt;version&gt;4.3.2.RELEASE&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
          &lt;artifactId&gt;javax.annotation-api&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.12&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.itextpdf&lt;/groupId&gt;
          &lt;artifactId&gt;itextpdf&lt;/artifactId&gt;
          &lt;version&gt;5.0.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.opencsv&lt;/groupId&gt;
          &lt;artifactId&gt;opencsv&lt;/artifactId&gt;
          &lt;version&gt;3.8&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-httpclient&lt;/groupId&gt;
          &lt;artifactId&gt;commons-httpclient&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-ooxml-schemas&lt;/artifactId&gt;
          &lt;version&gt;3.11&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-scratchpad&lt;/artifactId&gt;
          &lt;version&gt;3.2-FINAL&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.xmlbeans&lt;/groupId&gt;
          &lt;artifactId&gt;xmlbeans&lt;/artifactId&gt;
          &lt;version&gt;2.6.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;jstl&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-bundle&lt;/artifactId&gt;
          &lt;version&gt;1.19.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
          &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
          &lt;version&gt;1.10.19&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.scribe&lt;/groupId&gt;
          &lt;artifactId&gt;scribe&lt;/artifactId&gt;
          &lt;version&gt;1.3.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.squareup.retrofit2&lt;/groupId&gt;
          &lt;artifactId&gt;retrofit&lt;/artifactId&gt;
          &lt;version&gt;2.4.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.squareup.okhttp3&lt;/groupId&gt;
          &lt;artifactId&gt;logging-interceptor&lt;/artifactId&gt;
          &lt;version&gt;3.10.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.springfox&lt;/groupId&gt;
          &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
          &lt;version&gt;2.8.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.springfox&lt;/groupId&gt;
          &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
          &lt;version&gt;2.8.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-jms&lt;/artifactId&gt;
          &lt;version&gt;4.3.2.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.dataformat&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-dataformat-xml&lt;/artifactId&gt;
          &lt;version&gt;2.9.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
          &lt;artifactId&gt;gson&lt;/artifactId&gt;
          &lt;version&gt;2.8.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.squareup.retrofit2&lt;/groupId&gt;
          &lt;artifactId&gt;retrofit&lt;/artifactId&gt;
          &lt;version&gt;2.4.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.squareup.okhttp3&lt;/groupId&gt;
          &lt;artifactId&gt;logging-interceptor&lt;/artifactId&gt;
          &lt;version&gt;3.10.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.squareup.retrofit2&lt;/groupId&gt;
          &lt;artifactId&gt;converter-jackson&lt;/artifactId&gt;
          &lt;version&gt;2.4.0&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  <p>and also a plugin:</p>
  <pre><code>&lt;plugin&gt;
              &lt;groupId&gt;io.github.robwin&lt;/groupId&gt;
              &lt;artifactId&gt;swagger2markup-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;0.9.3&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;inputDirectory&gt;${project.basedir}/apiDoc/json&lt;/inputDirectory&gt;
                  &lt;swaggerFile&gt;swagger.json&lt;/swaggerFile&gt;
                  &lt;outputDirectory&gt;${project.basedir}/apiDoc/asciidoc&lt;/outputDirectory&gt;
                  &lt;markupLanguage&gt;asciidoc&lt;/markupLanguage&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;process-classes&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;process-swagger&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  <p>I have stored the apiDocs under my project folder.</p>
  <p>I am getting a 404 error whenever i call my {project_name}/prefix2/swagger-ui.html#</p>
  <p><a href="https://i.stack.imgur.com/jlGYh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jlGYh.png" alt="enter image description here" /></a>
  and whenever i call {project_name}/swagger-ui.html# url, i get this
  <a href="https://i.stack.imgur.com/TuqiU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TuqiU.png" alt="enter image description here" /></a></p>
  <p>Also, the swagger-ui.html does not get loaded in the apis.
  <a href="https://i.stack.imgur.com/Rz3bK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rz3bK.png" alt="enter image description here" /></a></p>
  <p>How can i solve this issue?
  Thanks,</p>