title: Spring boot application exception java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectWriter.forType
body: <p>I am working on a Spring boot 1.5.9 application with JDK 1.8.2.</p>
  
  <p>In debug mode with Intellij Ultimate edition, when the application tries to call a Rest API Method, there is an exception thrown like below;</p>
  
  <p>I tried changing or adding different versions of 'com.faster' dependencies but no luck.</p>
  
  <pre><code>&lt;jackson.version&gt;2.8.8&lt;/jackson.version&gt;
  </code></pre>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
      &lt;version&gt;${jackson.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
      &lt;version&gt;${jackson.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.module&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-module-jaxb-annotations&lt;/artifactId&gt;
      &lt;version&gt;${jackson.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <pre><code>Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectWriter.forType(Lcom/fasterxml/jackson/databind/JavaType;)Lcom/fasterxml/jackson/databind/ObjectWriter;
      at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:279)
      at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:106)
      at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:870)
      at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:657)
      at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:620)
      at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:387)
      at com.YYY.XXX.servicehelper.ContentServiceHelper.getPageContentWithLangNew(ContentServiceHelper.java:98)
      at com.YYY.XXX.servicehelper.ContentServiceHelper$$FastClassBySpringCGLIB$$9d352ef9.invoke(&lt;generated&gt;)
      at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52)
      at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:344)
      at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:407)
      at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:326)
      at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
  </code></pre>
  
  <p>Here is the dependency tree.</p>
  
  <pre><code>[INFO] -------------------------&lt; com.YYY:XXXWeb &gt;-------------------------
  [INFO] Building XXXWeb 0.0.1-SNAPSHOT
  [INFO] --------------------------------[ war ]---------------------------------
  [INFO]
  [INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ XXXWeb ---
  [INFO] com.YYY:XXXWeb:war:0.0.1-SNAPSHOT
  [INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.8:compile
  [INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.8.8:compile
  [INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.8:compile
  [INFO] +- com.YYY:XXXBackendLib:jar:0.1-SNAPSHOT:compile
  [INFO] |  \- commons-codec:commons-codec:jar:1.10:compile
  [INFO] +- com.YYY:PaymentModuleLib:jar:0.1:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.9.RELEASE:compile
  [INFO] |  +- org.springframework.boot:spring-boot-starter:jar:1.5.9.RELEASE:compile
  [INFO] |  |  +- org.springframework.boot:spring-boot:jar:1.5.9.RELEASE:compile
  [INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.9.RELEASE:compile
  [INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.9.RELEASE:compile
  [INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.1.11:compile
  [INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.1.11:compile
  [INFO] |  |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
  [INFO] |  |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
  [INFO] |  |  \- org.yaml:snakeyaml:jar:1.17:runtime
  [INFO] |  +- org.hibernate:hibernate-validator:jar:5.3.6.Final:compile
  [INFO] |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
  [INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
  [INFO] |  |  \- com.fasterxml:classmate:jar:1.3.4:compile
  [INFO] |  +- org.springframework:spring-web:jar:4.3.13.RELEASE:compile
  [INFO] |  |  \- org.springframework:spring-beans:jar:4.3.13.RELEASE:compile
  [INFO] |  \- org.springframework:spring-webmvc:jar:4.3.13.RELEASE:compile
  [INFO] |     \- org.springframework:spring-expression:jar:4.3.13.RELEASE:compile
  [INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.5:compile
  [INFO] |  \- org.apache.httpcomponents:httpcore:jar:4.4.8:compile
  [INFO] +- com.bkm:bexandroidsdk:jar:1.2.0:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.9.RELEASE:compile
  [INFO] |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile
  [INFO] |  |  \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:compile
  [INFO] |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile
  [INFO] |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
  [INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:1.5.9.RELEASE:compile
  [INFO] |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.5.9.RELEASE:compile
  [INFO] |  +- org.springframework:spring-aop:jar:4.3.13.RELEASE:compile
  [INFO] |  +- org.springframework.security:spring-security-config:jar:4.2.3.RELEASE:compile
  [INFO] |  |  \- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
  [INFO] |  \- org.springframework.security:spring-security-web:jar:4.2.3.RELEASE:compile
  [INFO] +- org.springframework.boot:spring-boot-starter-cache:jar:1.5.9.RELEASE:compile
  [INFO] |  +- org.springframework:spring-context:jar:4.3.13.RELEASE:compile
  [INFO] |  \- org.springframework:spring-context-support:jar:4.3.13.RELEASE:compile
  [INFO] +- javax.servlet:jstl:jar:1.2:compile
  [INFO] +- org.springframework.session:spring-session:jar:1.3.1.RELEASE:compile
  [INFO] +- com.aerospike:spring-session-aerospike:jar:1.0.0.RELEASE:compile
  [INFO] +- com.aerospike:spring-data-aerospike:jar:1.0.2.RELEASE:compile
  [INFO] |  +- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
  [INFO] |  +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
  [INFO] |  +- org.springframework:spring-tx:jar:4.3.13.RELEASE:compile
  [INFO] |  +- com.aerospike:aerospike-helper-java:jar:1.2:compile
  [INFO] |  +- log4j:log4j:jar:1.2.17:compile
  [INFO] |  +- org.slf4j:slf4j-api:jar:1.7.25:compile
  [INFO] |  \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
  [INFO] +- com.aerospike:aerospike-client:jar:4.0.8:compile
  [INFO] |  +- org.gnu:gnu-crypto:jar:2.0.1:compile
  [INFO] |  +- org.luaj:luaj-jse:jar:3.0:compile
  [INFO] |  \- org.mindrot:jbcrypt:jar:0.3m:compile
  [INFO] +- org.apache.tomcat.embed:tomcat-embed-jasper:jar:8.5.23:compile
  [INFO] |  \- org.eclipse.jdt:ecj:jar:3.12.3:compile
  [INFO] +- de.codecentric:spring-boot-admin-starter-client:jar:1.5.2:compile
  [INFO] |  +- org.springframework.boot:spring-boot-starter-actuator:jar:1.5.9.RELEASE:compile
  [INFO] |  |  \- org.springframework.boot:spring-boot-actuator:jar:1.5.9.RELEASE:compile
  [INFO] |  +- org.jolokia:jolokia-core:jar:1.3.7:compile
  [INFO] |  \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
  [INFO] +- com.itextpdf:itextpdf:jar:5.4.5:compile
  [INFO] +- biz.paluch.logging:logstash-gelf:jar:1.11.2:compile
  [INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.5.9.RELEASE:test
  [INFO]    +- org.springframework.boot:spring-boot-test:jar:1.5.9.RELEASE:test
  [INFO]    +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.9.RELEASE:test
  [INFO]    +- com.jayway.jsonpath:json-path:jar:2.2.0:test
  [INFO]    |  \- net.minidev:json-smart:jar:2.2.1:test
  [INFO]    |     \- net.minidev:accessors-smart:jar:1.1:test
  [INFO]    |        \- org.ow2.asm:asm:jar:5.0.3:test
  [INFO]    +- junit:junit:jar:4.12:compile
  [INFO]    +- org.assertj:assertj-core:jar:2.6.0:test
  [INFO]    +- org.mockito:mockito-core:jar:1.10.19:test
  [INFO]    |  \- org.objenesis:objenesis:jar:2.1:test
  [INFO]    +- org.hamcrest:hamcrest-core:jar:1.3:compile
  [INFO]    +- org.hamcrest:hamcrest-library:jar:1.3:test
  [INFO]    +- org.skyscreamer:jsonassert:jar:1.4.0:test
  [INFO]    +- org.springframework:spring-core:jar:4.3.13.RELEASE:compile
  [INFO]    \- org.springframework:spring-test:jar:4.3.13.RELEASE:test
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  1.535 s
  [INFO] Finished at: 2019-06-22T11:45:31+03:00
  [INFO] ------------------------------------------------------------------------
  </code></pre>