title: Spring Boot REST API will not start when importing a dependency from a different application module
body: <p>I am building a REST API with Spring Boot as our other API uses Drop-wizard and does not use Spring. I need to use some code, specifically JMS code to send messages to various different parts of an application, hence the build of a new API so we can import dependencies from different modules. I have the API working perfectly, until I import a dependency which I need to access the already written JMS code.</p>
  
  <p>I have been through various different sources to try and find if there are any mismatched versions between my spring boot dependencies and the spring dependencies that the other module uses.</p>
  
  <p>I have consulted my colleagues (who have 30 years experience between them) and are unable to come up with an answer.</p>
  
  <p>I have tried using different versions of spring-boot to see if this fixes the problem.</p>
  
  <p>I am using the following parent version of Spring-Boot</p>
  
  <pre><code> &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.0.5.RELEASE&lt;/version&gt;
      &lt;relativePath /&gt;
  &lt;/parent&gt;
  </code></pre>
  
  <p>And then using the following dependencies:</p>
  
  <pre><code>&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;/dependency&gt;
  </code></pre>
  
  <p>I can send various different GET &amp; POST requests to the different endpoints and everything is working fine, until I place this dependency into my pom.xml (Which is from another module of a production system):</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.kinesisfleet.messaging&lt;/groupId&gt;
      &lt;artifactId&gt;kinesis-messaging&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The pom for this particular module of the system uses spring using the following dependencies:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
    &lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-jms&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
    &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The versions of Spring we use are the following:</p>
  
  <pre><code>```Spring Version - 4.2.0.RELEASE
  Spring Data Version - 1.8.2.RELEASE
  Spring Integration Version - 4.1.6.RELEASE```
  </code></pre>
  
  <p>Once the dependency is added, I cannot start the app and get the following error:</p>
  
  <pre><code>    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:673) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:519) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:333) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
      at com.kinesis.spring.api.KinesisCoreSpringApi.main(KinesisCoreSpringApi.java:21) [classes/:na]
  Caused by: java.lang.NullPointerException: null
      at org.springframework.core.BridgeMethodResolver.findBridgedMethod(BridgeMethodResolver.java:60) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE]
      at org.springframework.beans.GenericTypeAwarePropertyDescriptor.&lt;init&gt;(GenericTypeAwarePropertyDescriptor.java:70) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.CachedIntrospectionResults.buildGenericTypeAwarePropertyDescriptor(CachedIntrospectionResults.java:348) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.CachedIntrospectionResults.&lt;init&gt;(CachedIntrospectionResults.java:302) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:189) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:175) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.BeanWrapperImpl.getLocalPropertyHandler(BeanWrapperImpl.java:212) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.BeanWrapperImpl.getLocalPropertyHandler(BeanWrapperImpl.java:63) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyHandler(AbstractNestablePropertyAccessor.java:725) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.AbstractNestablePropertyAccessor.isWritableProperty(AbstractNestablePropertyAccessor.java:557) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1483) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE
  
  
  
      It looks to be some sort of version mismatch, between the imported 
      dependency and the spring boot parent version.
  
      I am finding this very frustrating ad have spent nearly two days 
      trying to figure this out. Although im a junior dev, i've fixed 
      these sorts of issues lots of times, but this one if proving 
      difficult.
  
      If anyone has any ideas or pointers It would be appreciated
  
     Thanks
  </code></pre>