title: Does Spring Cloud Gateway and Swagger have compatibility issue, getting errors
body: <p>I am doing hands-on with creating microservices with Spring Cloud Gateway and Swagger. Unable to start my application. It is giving <strong>Failed to introspect annotated methods on class springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration</strong> error which needs <strong>spring-boot-starter-web</strong> dependency. But on including this dependency, getting error <strong>Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. Please remove spring-boot-starter-web dependency.</strong></p>
  <p>Can't we use Swagger with Spring Cloud Gateway?</p>
  <p><strong>1st Microservice:</strong></p>
  <p><strong>Code</strong></p>
  <p><strong>pom.xml:</strong></p>
  <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.3.4.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;SCG&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;SCG&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Cloud Gateway having two MS.&lt;/description&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;11&lt;/java.version&gt;
          &lt;spring-cloud.version&gt;Hoxton.SR8&lt;/spring-cloud.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
           &lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt; 
              &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-starter-gateway&lt;/artifactId&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.9.2&lt;/version&gt;
          &lt;/dependency&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.9.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
              &lt;optional&gt;true&lt;/optional&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.junit.vintage&lt;/groupId&gt;
                      &lt;artifactId&gt;junit-vintage-engine&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
                  &lt;version&gt;${spring-cloud.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  <p><strong>SPringCloudConfig</strong>:</p>
  <pre><code>   package com.ashish.mongo1.config;
  
  import org.springframework.cloud.gateway.route.RouteLocator;
  import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.reactive.config.ResourceHandlerRegistry;
  
  @Configuration
  public class SPringCloudConfig {
  
      @Bean
      public RouteLocator gatewayRoutes(RouteLocatorBuilder builder) {
          return builder.routes()
                  .route(r -&gt; r.path(&quot;/ms/ms2&quot;)
                          .uri(&quot;http://localhost:8081/&quot;)
                          .id(&quot;firstMS&quot;))
                  .build();
      }
      
  }
  </code></pre>
  <p><strong>Bootstrap class:</strong></p>
  <pre><code>    package com.ashish.mongo1;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.annotation.Bean;
  import org.springframework.web.client.RestTemplate;
  
  import springfox.documentation.builders.PathSelectors;
  import springfox.documentation.builders.RequestHandlerSelectors;
  import springfox.documentation.service.ApiInfo;
  import springfox.documentation.spi.DocumentationType;
  import springfox.documentation.spring.web.plugins.Docket;
  import springfox.documentation.swagger2.annotations.EnableSwagger2;
  
  @SpringBootApplication
  @EnableSwagger2
  public class ScgApplication {
      
      RestTemplate rt;
  
      public static void main(String[] args) {
          SpringApplication.run(ScgApplication.class, args);
      }
  
      public RestTemplate restTemplate() {
          return new RestTemplate();
      }
      
      @Bean
      public Docket swaggerConfiguration() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .paths(PathSelectors.ant(&quot;/ms/*&quot;))
                  .apis(RequestHandlerSelectors.basePackage(&quot;com.ashish.mongo1&quot;))
                  .build()
                  .apiInfo(apiInfo());
      }
  
      @SuppressWarnings(&quot;deprecation&quot;)
      private ApiInfo apiInfo() {
          return new ApiInfo(
                  &quot;Microservice 2&quot;, 
                  &quot;Sample API for Swagger Use&quot;, 
                  &quot;1.0&quot;, 
                  &quot;Free to use&quot;, 
                  &quot;Ashish Kumar&quot;, 
                  &quot;API License&quot;, 
                  &quot;http://localhost:8080/ms/ms2&quot;);
      }
  }
  </code></pre>
  <p><strong>Controller:</strong></p>
  <pre><code>    package com.ashish.mongo1.controller;
  
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  import org.springframework.web.client.RestTemplate;
  
  @RestController
  @RequestMapping(&quot;/ms&quot;)
  public class FirstMSResource {
  
      RestTemplate rt = restTemplate();
      @GetMapping(&quot;/ms1&quot;)
      public String firstMS() {
          String s = rt.getForObject(&quot;http://localhost:8081/ms/ms2&quot;, String.class);
          return &quot;MS-1 called....&quot;+s;
      }
      
      public RestTemplate restTemplate() {
          return new RestTemplate();
      }
  }
  </code></pre>
  <p><strong>2nd Microservice:</strong></p>
  <p><strong>pom.xml:</strong></p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.3.4.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;SCG&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;SCG&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Cloud Gateway having two MS.&lt;/description&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;11&lt;/java.version&gt;
          &lt;spring-cloud.version&gt;Hoxton.SR8&lt;/spring-cloud.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&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.9.2&lt;/version&gt;
          &lt;/dependency&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.9.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
              &lt;optional&gt;true&lt;/optional&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.junit.vintage&lt;/groupId&gt;
                      &lt;artifactId&gt;junit-vintage-engine&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
                  &lt;version&gt;${spring-cloud.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  <p><strong>application.yml:</strong></p>
  <pre><code>server:
    port: 8081
  </code></pre>
  <p><strong>Controller:</strong></p>
  <pre><code>    package com.ashish.mongo1.controller;
  
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController
  @RequestMapping(&quot;/ms&quot;)
  public class SecondMSResource {
  
      @GetMapping(&quot;/ms2&quot;)
      public String firstMS() {
          return &quot;MS-2 called....&quot;;
      }
  }
  </code></pre>
  <p><strong>Bootstrap class:</strong></p>
  <pre><code>    package com.ashish.mongo1;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.annotation.Bean;
  
  import springfox.documentation.builders.PathSelectors;
  import springfox.documentation.builders.RequestHandlerSelectors;
  import springfox.documentation.service.ApiInfo;
  import springfox.documentation.spi.DocumentationType;
  import springfox.documentation.spring.web.plugins.Docket;
  import springfox.documentation.swagger2.annotations.EnableSwagger2;
  
      @SpringBootApplication
      @EnableSwagger2
      public class ScgApplication {
      
          public static void main(String[] args) {
              SpringApplication.run(ScgApplication.class, args);
          }
          
          @Bean
          public Docket swaggerConfiguration() {
              return new Docket(DocumentationType.SWAGGER_2)
                      .select()
                      .paths(PathSelectors.ant(&quot;/ms/*&quot;))
                      .apis(RequestHandlerSelectors.basePackage(&quot;com.ashish.mongo1&quot;))
                      .build()
                      .apiInfo(apiInfo());
          }
      
          @SuppressWarnings(&quot;deprecation&quot;)
          private ApiInfo apiInfo() {
              return new ApiInfo(
                      &quot;Microservice 2&quot;, 
                      &quot;Sample API for Swagger Use&quot;, 
                      &quot;1.0&quot;, 
                      &quot;Free to use&quot;, 
                      &quot;Ashish Kumar&quot;, 
                      &quot;API License&quot;, 
                      &quot;http://localhost:8080/ms/ms2&quot;);
          }
      
      }
  </code></pre>
  <p>getting following error on running the application:</p>
  <pre><code>2020-10-24 23:06:16.500  INFO 19896 --- [  restartedMain] com.ashish.mongo1.ScgApplication         : No active profile set, falling back to default profiles: default
  2020-10-24 23:06:17.520  INFO 19896 --- [  restartedMain] o.s.cloud.context.scope.GenericScope     : BeanFactory id=863b9547-dc4a-3869-8a25-0fd2918e238c
  2020-10-24 23:06:17.992  INFO 19896 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
  2020-10-24 23:06:18.002  INFO 19896 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
  2020-10-24 23:06:18.002  INFO 19896 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.38]
  2020-10-24 23:06:18.135  INFO 19896 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  2020-10-24 23:06:18.135  INFO 19896 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1622 ms
  2020-10-24 23:06:18.483  INFO 19896 --- [  restartedMain] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2Controller#getDocumentation(String, HttpServletRequest)]
  2020-10-24 23:06:18.527  WARN 19896 --- [  restartedMain] GatewayClassPathWarningAutoConfiguration : 
  
  **********************************************************
  
  **Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. Please remove spring-boot-starter-web dependency.**
  
  **********************************************************
  
  
  WARNING: An illegal reflective access operation has occurred
  WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils (file:/C:/Users/send2/.m2/repository/org/springframework/spring-core/5.2.9.RELEASE/spring-core-5.2.9.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
  WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils
  WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  WARNING: All illegal access operations will be denied in a future release
  2020-10-24 23:06:18.956  WARN 19896 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'routeDefinitionRouteLocator' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'routeDefinitionRouteLocator' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'modifyRequestBodyGatewayFilterFactory' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'modifyRequestBodyGatewayFilterFactory' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.http.codec.ServerCodecConfigurer' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
  2020-10-24 23:06:18.958  INFO 19896 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
  2020-10-24 23:06:18.973  INFO 19896 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 
  
  Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  2020-10-24 23:06:19.141 ERROR 19896 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 
  
  ***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found.
  
  
  Action:
  
  **Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.**
  </code></pre>
  <p>and</p>
  <p>After removing the <strong>spring-boot-starter-web</strong> dependency, getting following error:</p>
  <pre><code>    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  2020-10-24 23:29:05.719 ERROR 19676 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed
  
  org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.ashish.mongo1.ScgApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration
      at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:610) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:311) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:319) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:280) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:96) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:707) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:62) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
      at com.ashish.mongo1.ScgApplication.main(ScgApplication.java:22) ~[classes/:na]
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
      at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
      at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.3.4.RELEASE.jar:2.3.4.RELEASE]
  Caused by: java.lang.IllegalStateException: **Failed to introspect annotated methods on class springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration**
      at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:162) ~[spring-core-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassParser.retrieveBeanMethodMetadata(ConfigurationClassParser.java:403) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:326) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:600) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      ... 23 common frames omitted
  Caused by: java.lang.IllegalStateException: Failed to introspect Class [springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@2626b418]
      at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481) ~[spring-core-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:455) ~[spring-core-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:151) ~[spring-core-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      ... 27 common frames omitted
  Caused by: java.lang.NoClassDefFoundError: org/springframework/web/servlet/HandlerMapping
      at java.base/java.lang.Class.getDeclaredMethods0(Native Method) ~[na:na]
      at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3244) ~[na:na]
      at java.base/java.lang.Class.getDeclaredMethods(Class.java:2387) ~[na:na]
      at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463) ~[spring-core-5.2.9.RELEASE.jar:5.2.9.RELEASE]
      ... 29 common frames omitted
  Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.HandlerMapping
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602) ~[na:na]
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
      ... 33 common frames omitted
  </code></pre>