title: java.lang.IncompatibleClassChangeError while starting a Spring Boot 2.1.1 and Java 11 application
body: <p>I'm getting a <code>java.lang.IncompatibleClassChangeError</code> while starting spring-boot <em>2.1.1.RELEASE</em> application on <em>jdk-11.0.6</em> in order to migrate existing spring-boot application from <em>1.5.3</em> and <em>Java 8</em>.</p>
  
  <p>In addition to these settings, I also override versions of <code>spring-boot-starter</code> dependencies with the <em>2.1.1.RELEASE</em> to prevent incompatible library problem. In addition to Java 11, I'm also using groovy <em>3.0.0-alpha-4</em> in the same project.</p>
  
  <p>You can find detailed stacktrace below:</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pathMappedEndpoints' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints]: Factory method 'pathMappedEndpoints' threw exception; nested exception is java.lang.IncompatibleClassChangeError: Method org.springframework.boot.actuate.endpoint.web.PathMapper.__AW_getRootPath(Ljava/util/List;Lorg/springframework/boot/actuate/endpoint/EndpointId;)Ljava/lang/String; must be InterfaceMethodref c
      at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
      at org.springframework.beans.factory.support.ConstructorResolver.__AW_instantiateUsingFactoryMethod(ConstructorResolver.java:607)
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.__AW_createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.__AW_doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.__AW_createBean(AbstractAutowireCapableBeanFactory.java:498)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java)
      at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.__AW_getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java)
      at org.springframework.beans.factory.support.AbstractBeanFactory.__AW_doGetBean(AbstractBeanFactory.java:318)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.__AW_preInstantiateSingletons(DefaultListableBeanFactory.java:846)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java)
      at org.springframework.context.support.AbstractApplicationContext.__AW_finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
      at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
      at org.springframework.boot.SpringApplication.__AW_run(SpringApplication.java:316)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java)
      at com.demo.api.Application.__AW_main(Application.java:22)
      at com.demo.api.Application.main(Application.java)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
      at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
      at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
      at org.springframework.boot.loader.JarLauncher.__AW_main(JarLauncher.java:51)
      at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java)
  Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints]: Factory method 'pathMappedEndpoints' threw exception; nested exception is java.lang.IncompatibleClassChangeError: Method org.springframework.boot.actuate.endpoint.web.PathMapper.__AW_getRootPath(Ljava/util/List;Lorg/springframework/boot/actuate/endpoint/EndpointId;)Ljava/lang/String; must be InterfaceMethodref c
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.__AW_instantiate(SimpleInstantiationStrategy.java:185)
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java)
      at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
      ... 36 common frames omitted
  Caused by: java.lang.IncompatibleClassChangeError: Method org.springframework.boot.actuate.endpoint.web.PathMapper.__AW_getRootPath(Ljava/util/List;Lorg/springframework/boot/actuate/endpoint/EndpointId;)Ljava/lang/String; must be InterfaceMethodref c
      at org.springframework.boot.actuate.endpoint.web.PathMapper.getRootPath(PathMapper.java)
      at org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer.createEndpoint(ServletEndpointDiscoverer.java:71)
      at org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer.createEndpoint(ServletEndpointDiscoverer.java:42)
      at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.getFilterEndpoint(EndpointDiscoverer.java:328)
      at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.isFilterMatch(EndpointDiscoverer.java:302)
      at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.isEndpointExposed(EndpointDiscoverer.java:270)
      at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.convertToEndpoints(EndpointDiscoverer.java:189)
      at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.discoverEndpoints(EndpointDiscoverer.java:127)
      at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.getEndpoints(EndpointDiscoverer.java:119)
      at org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints.lambda$getEndpoints$1(PathMappedEndpoints.java:70)
      at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608)
      at org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints.getEndpoints(PathMappedEndpoints.java:69)
      at org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints.&lt;init&gt;(PathMappedEndpoints.java:63)
      at org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration.pathMappedEndpoints(WebEndpointAutoConfiguration.java:123)
      at org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$7e6a4261.CGLIB$pathMappedEndpoints$1(&lt;generated&gt;)
      at org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$7e6a4261$$FastClassBySpringCGLIB$$9430a0e5.invoke(&lt;generated&gt;)
      at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
      at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
      at org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$7e6a4261.pathMappedEndpoints(&lt;generated&gt;)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.__AW_instantiate(SimpleInstantiationStrategy.java:154)
      ... 38 common frames omitted
  </code></pre>