title: SpringBoot BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' Caused by: java.lang.NoSuchFieldError: defaultInstance
body: <p>I have a SpringBoot + Maven project with JPA. When tring to run the application I got the following error stack.</p>
  <blockquote>
  <p>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: defaultInstance
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[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.pasindu.dockerexample.DockerExampleApplication.main(DockerExampleApplication.java:14) [classes/:na]
  Caused by: java.lang.NoSuchFieldError: defaultInstance
  at org.springframework.web.servlet.mvc.method.annotation.ServletCookieValueMethodArgumentResolver.(ServletCookieValueMethodArgumentResolver.java:40) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.getDefaultArgumentResolvers(RequestMappingHandlerAdapter.java:648) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.afterPropertiesSet(RequestMappingHandlerAdapter.java:561) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
  ... 17 common frames omitted
  Process finished with exit code 1</p>
  </blockquote>
  <p>Below is my pom.xml file.</p>
  <pre><code> &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.demo&lt;/groupId&gt;
   &lt;artifactId&gt;docker-example&lt;/artifactId&gt;
   &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
   &lt;name&gt;docker-example&lt;/name&gt;
   &lt;description&gt;Docker Example&lt;/description&gt;
  
   &lt;properties&gt;
       &lt;java.version&gt;1.8&lt;/java.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&lt;/artifactId&gt;
       &lt;/dependency&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.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;dependency&gt;
           &lt;groupId&gt;org.springframework&lt;/groupId&gt;
           &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
           &lt;version&gt;5.2.8.RELEASE&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --&gt;
       &lt;dependency&gt;
           &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
           &lt;artifactId&gt;lombok&lt;/artifactId&gt;
           &lt;version&gt;1.18.12&lt;/version&gt;
           &lt;scope&gt;provided&lt;/scope&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
           &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
           &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
           &lt;groupId&gt;mysql&lt;/groupId&gt;
           &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
           &lt;version&gt;8.0.18&lt;/version&gt;
       &lt;/dependency&gt;
   &lt;/dependencies&gt;
  
   &lt;build&gt;
       &lt;finalName&gt;app&lt;/finalName&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>Any idea of how to fix this ?</p>