title: BeanCreationException when creating an ElasticSearchRepository - Could not resolve matching constructor
body: <p>We have a spring boot application with maven. From today it started throwing the below error. There were few changes yesterday, we tried rolling back to a older version of code but still same error.</p>
  
  <pre><code>java.lang.IllegalStateException: Error processing condition on org.springframework.boot.devtools.autoconfigure.DevToolsDataSourceAutoConfiguration
  at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64)
  at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102)
  at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:436)
  at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:425)
  at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:127)
  at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
  at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:336)
  at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:246)
  at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270)
  at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93)
  at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
  at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
  at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
  at com.infy.mp.MarketplaceApp.main(MarketplaceApp.java:64)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationSearchRepository': Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)
  at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1148)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:881)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:808)
  at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:544)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:390)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:384)
  at org.springframework.boot.devtools.autoconfigure.DevToolsDataSourceAutoConfiguration$DevToolsDataSourceCondition.getMatchOutcome(DevToolsDataSourceAutoConfiguration.java:133)
  at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
  ... 21 common frames omitted
  
  2016-12-16 12:26:26.519  WARN 7772 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Exception thrown from LifecycleProcessor on context close
  
  java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4435f708: startup date [Fri Dec 16 12:26:18 IST 2016]; root of context hierarchy
  at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:417)
  at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1002)
  at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961)
  at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:818)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
  at com.infy.mp.MarketplaceApp.main(MarketplaceApp.java:64)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
  
  2016-12-16 12:26:26.520 ERROR 7772 --- [  restartedMain] o.s.b.f.s.DefaultListableBeanFactory     : Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
  
  java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4435f708: startup date [Fri Dec 16 12:26:18 IST 2016]; root of context hierarchy
  at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404)
  at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97)
  at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:954)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:961)
  at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033)
  at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1009)
  at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961)
  at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:818)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
  at com.infy.mp.MarketplaceApp.main(MarketplaceApp.java:64)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
  </code></pre>
  
  <p>Below is the ApplicationSearchRepository interface</p>
  
  <pre><code>package com.test.mp.search.repository;
  
  import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
  import com.test.mp.domain.application.ApplicationElasticSearch;
  
  public interface ApplicationSearchRepository extends ElasticsearchRepository&lt;ApplicationElasticSearch, String&gt; {
  public ApplicationElasticSearch findOneByJobIdAndPosterIdAndSeekerProfileId(String jobid, String posterid, String seekerprofileid);
  </code></pre>
  
  <p>I'm quite new to java, please let me know if you need any other info. </p>
  
  <p><strong>Update</strong></p>
  
  <p>The issue resolved after updating maven dependency versions of spring-data-* packages like below (non-working versions in comments).</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-commons&lt;/artifactId&gt;
          &lt;!--&lt;version&gt;1.13.0.BUILD-SNAPSHOT&lt;/version&gt;--&gt;
          &lt;version&gt;1.13.0.M1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-cassandra&lt;/artifactId&gt;
          &lt;!--&lt;version&gt;1.5.0.BUILD-SNAPSHOT&lt;/version&gt;--&gt;
          &lt;version&gt;2.0.0.M1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-cql&lt;/artifactId&gt;
          &lt;!--&lt;version&gt;1.5.0.BUILD-SNAPSHOT&lt;/version&gt;--&gt;
          &lt;version&gt;2.0.0.M1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>But now the integration tests continue to throw the same error. There are no spring-data related dependencies in test scope except cassandra-unit. Any clue why tests are failing?</p>