Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Elasticsearch 2.0 [DATAES-211] #784

Closed
spring-projects-issues opened this issue Nov 5, 2015 · 35 comments
Closed

Upgrade to Elasticsearch 2.0 [DATAES-211] #784

spring-projects-issues opened this issue Nov 5, 2015 · 35 comments
Labels
has: votes-jira in: core type: dependency-upgrade type: documentation

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Nov 5, 2015

Christoph Strobl opened DATAES-211 and commented

Upgrade to ES 2.0

The upgrade might require the following and requires some investigation.

  • Replace Facets with the according Aggregations.
  • Replace removed Builders by their new QueryBuilder counterparts.
  • Remove "memory" option for "index.store.type"
  • Find alternative for "delete query" which has been removed in 2.0
  • ...

There's quite a bit to change through out the whole API which makes me think that this upgrade might require a major version bump.


I've a draft implementation at hand removing the compile errors and making sure the node client starts up. The draft is far from perfect and deals only with some parts of the above mentioned throwing UnsupportedOperationException on those I could not solve quickly - let me know if you want to have a look, in that case I can clean things up a bit and provide you with the branch


39 votes, 47 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Dec 9, 2015

Przemek commented

Do you have any road map / timeline for the support of version 2.0 and above?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Dec 22, 2015

Mohsin Husen commented

We are working on supporting 2.x, this will be available with Spring data "Hopper" release.

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Dec 30, 2015

Abhishek Ranjan commented

I tried working with the Spring Data Elasticsearch 1.4.Snapshot Build which is part of Hopper release but it also has elasticsearch 1.7.3.

Is there a timeline in which even a Snapshot Build will be available with 2.x support ?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 13, 2016

Youcef HILEM commented

I tried working with the Spring Data Elasticsearch 1.4.Snapshot But I can't compile.

Compilation errors :

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Data Elasticsearch 1.4.0.DATAES-211-SNAPSHOT
[INFO] ------------------------------------------------------------------------
.........
.........
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java:[37,17] constructor QueryMethod in class org.springframework.data.repository.query.QueryMethod cannot be applied to given types;
required: java.lang.reflect.Method,org.springframework.data.repository.core.RepositoryMetadata,org.springframework.data.projection.ProjectionFactory
found: java.lang.reflect.Method,org.springframework.data.repository.core.RepositoryMetadata
reason: actual and formal argument lists differ in length
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java:[628,120] cannot find symbol
symbol: method mappings()
location: class org.elasticsearch.cluster.metadata.IndexMetaData
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java:[649,68] cannot find symbol
symbol: method mappings()
location: class org.elasticsearch.cluster.metadata.IndexMetaData
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java:[92,17] org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory.ElasticsearchQueryLookupStrategy is not abstract and does not override abstract method resolveQuery(java.lang.reflect.Method,org.springframework.data.repository.core.RepositoryMetadata,org.springframework.data.projection.ProjectionFactory,org.springframework.data.repository.core.NamedQueries) in org.springframework.data.repository.query.QueryLookupStrategy
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java:[94,17] method does not override or implement a method from a supertype
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:09 min
[INFO] Finished at: 2016-01-13T07:37:56+01:00
[INFO] Final Memory: 21M/50M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project spring-data-elasticsearch: Compilation failure: Compilation failure:
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java:[37,17] constructor QueryMethod in class org.springframework.data.repository.query.QueryMethod cannot be applied to given types;
[ERROR] required: java.lang.reflect.Method,org.springframework.data.repository.core.RepositoryMetadata,org.springframework.data.projection.ProjectionFactory
[ERROR] found: java.lang.reflect.Method,org.springframework.data.repository.core.RepositoryMetadata
[ERROR] reason: actual and formal argument lists differ in length
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java:[628,120] cannot find symbol
[ERROR] symbol: method mappings()
[ERROR] location: class org.elasticsearch.cluster.metadata.IndexMetaData
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java:[649,68] cannot find symbol
[ERROR] symbol: method mappings()
[ERROR] location: class org.elasticsearch.cluster.metadata.IndexMetaData
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java:[92,17] org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory.ElasticsearchQueryLookupStrategy is not abstract and does not override abstract method resolveQuery(java.lang.reflect.Method,org.springframework.data.repository.core.RepositoryMetadata,org.springframework.data.projection.ProjectionFactory,org.springframework.data.repository.core.NamedQueries) in org.springframework.data.repository.query.QueryLookupStrategy
[ERROR] /D:/OpenSource/ELK/Spring/spring-data-elasticsearch_issues_DATAES-211/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java:[94,17] method does not override or implement a method from a supertype

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 15, 2016

rohit commented

Is there a timeline for this functionality to be released ?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 16, 2016

Mohsin Husen commented

we have working (compile + test) branch at

https://github.com/spring-projects/spring-data-elasticsearch/tree/DATAES-211-ES2.0

hopefully in a week or so we will merge this to master.

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 17, 2016

Johannes Unterstein commented

Gorgeous! :-)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 18, 2016

tC commented

Waiting passionately :)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 18, 2016

Bruno Domenici commented

Me toooo
:)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 19, 2016

Augusto David Altman Quaranta commented

Me too :D

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 19, 2016

Milan Agatonovic commented

And me too :)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 22, 2016

Raunak Gupta commented

Exciting! :D

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 24, 2016

Mohsin Husen commented

code is merged with master.

can be tested using adding below dependency

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>1.4.0.BUILD-SNAPSHOT</version>
</dependency>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot\
</repository>

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 24, 2016

Bruno Domenici commented

Thanks a lot.

I've updated references in my project and now I got this error:

11:20:22.676 [main] ERROR o.s.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@10612ba] to prepare test instance [xxx@1f34b70]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:230) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:249) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193) [spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:na]
Caused by: java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration.elasticsearchClient
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64) ~[spring-boot-autoconfigure-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:178) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116) ~[spring-test-4.2.4.RELEASE.jar:4.2.4.RELEASE]
... 25 common frames omitted
Caused by: java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)
at org.springframework.util.Assert.isTrue(Assert.java:68) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279) ~[spring-boot-autoconfigure-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.<init>(OnBeanCondition.java:275) ~[spring-boot-autoconfigure-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111) ~[spring-boot-autoconfigure-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-1.3.2.RELEASE.jar:1.3.2.RELEASE]
... 41 common frames omitted

Should I change anything in my configuration?
Regards

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 24, 2016

Joseph Moore commented

So I had found a bug with the config loading in the DATAES-211-ES-2.0 branch that causes any config inside a jar to fail to load, which breaks multi-level maven builds. I had made a simple 1-line PR to fix this issue against that branch (see #136), but the fix was never merged. Do I need to open this a a new ticket/new PR or what can we do if there is a known issue with this already? The project is unusable for my company's use without this bugfix, so this is a major priority that I don't want to see having to wait on another release when the bug was clear before the branch was even merged into master.

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 24, 2016

Joseph Moore commented

Made a new bug ticket to track the config issue I mentioned above with the merged code.
https://jira.spring.io/browse/DATAES-237

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 25, 2016

Christophe Mohimont commented

I have test yesterday. It works perfectly for me with Elasticsearch 2. Thanks for your work :)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 25, 2016

Johannes Unterstein commented

I upgraded today and it works perfectly for me as well! Thank you very much :)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 25, 2016

rohit commented

I am unable to run this build with spring boot 1.3.2 and 1.4.0.BUILD-SNAPSHOT. The error is
va.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration.elasticsearchClient
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64) ~[spring-boot-autoconfigure-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:178) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:768) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:362) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1183) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:0.0.1-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1172) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:0.0.1-SNAPSHOT]
at com.bottleview.server.Application.main(Application.java:19) [classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_72]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_72]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_72]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_72]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54) [server-app-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:101) [server-app-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [server-app-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58) [server-app-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
Caused by: java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)
at org.springframework.util.Assert.isTrue(Assert.java:68) ~[spring-core-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279) ~[spring-boot-autoconfigure-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.<init>(OnBeanCondition.java:275) ~[spring-boot-autoconfigure-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111) ~[spring-boot-autoconfigure-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
... 25 common frames omitted

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:62)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:101)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
Caused by: java.lang.reflect.InvocationTargetException
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.loader.MainMethodRunner.run(MainMethodRunner.java:54)
... 3 more
Caused by: java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration.elasticsearchClient
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.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:178)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:768)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:362)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1183)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1172)
at com.bottleview.server.Application.main(Application.java:19)
... 8 more
Caused by: java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)
at org.springframework.util.Assert.isTrue(Assert.java:68)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.<init>(OnBeanCondition.java:275)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
... 25 more

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 25, 2016

Christophe Mohimont commented

It's because you don't have snapshot version of spring-data-commons.

For fix this problem, in my pom.xml, I have add this properties:

<springdata.commons>1.12.0.BUILD-SNAPSHOT</springdata.commons>

and if you analyze your dependencies, you have probably bad version of elasticsearch. If true, add this in you pom properties:

<elasticsearch.version>2.2.0</elasticsearch.version>

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 25, 2016

Christophe Mohimont commented

Oups, I have forgot.

I have also add custom ElasticsearchConfig class:

@Configuration
@EnableConfigurationProperties(ElasticsearchProperties.class)
public class ElasticSearchConfig implements DisposableBean {

    @Autowired
    private ElasticsearchProperties properties;

    private Releasable releasable;

    @Bean
    public Client elasticSearchClient() throws Exception {
        TransportClientFactoryBean factory = new TransportClientFactoryBean();
        factory.setClusterNodes(properties.getClusterNodes());
        factory.setProperties(createProperties());
        factory.afterPropertiesSet();

        TransportClient transportClient = factory.getObject();
        releasable = transportClient;
        return transportClient;
    }

    private Properties createProperties() {
        Properties properties = new Properties();
        properties.put("cluster.name", this.properties.getClusterName());
        properties.putAll(this.properties.getProperties());
        return properties;
    }

    @Override
    public void destroy() throws Exception {
        releasable.close();
    }
}

and instead of using SpringBootApplication annotation, I have replaced by this:

@Configuration
@EnableAutoConfiguration(exclude = ElasticsearchAutoConfiguration.class)
@ComponentScan

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 26, 2016

rohit commented

WHich Spring Boot version are you suing spring boot 1.3.2 or 1.4.0.BUILD-SNAPSHOT ?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 26, 2016

Christophe Mohimont commented

Spring Boot 1.3.2 but I have force to use spring data in BUILD Snapshot like explain above

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 26, 2016

Shiv Prakash commented

Hi,

It is possible to cut out a RC1 release build for Spring Data ES with elastic search 2.0 ? I want to use Spring Data Elastic in my Spring Web project and the release plugin won't allow the release build from a SNAPSHOT build. I believe the framework is quite good and have a few idea of pull requests. I wanted to incorporate this is major release of my new app and could easily update once the RELEASE is available .

I have used the below until now for my code.

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>1.4.0.BUILD-SNAPSHOT</version>
</dependency>

I am quite hopeful which in otherwise I have to plan to write a custom using native client.

Thanks
Shiv Prakash

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 26, 2016

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 21, 2016

Vallab Chandrasekaran commented

Hi,

Can you please let me know the Spring-Data-Commons + Spring jars dependency for this version of Spring-Data-ES jar?

Also, I see there is a spring compatibility matrix in this thread.
http://stackoverflow.com/questions/21361599/is-there-a-spring-version-matrix-of-sub-projects-components

But the matrix is not updated to date. Can you please point to the latest matrix?

Thanks,
Vallab

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 21, 2016

Vallab Chandrasekaran commented

The same matrix is also found in the spring forum thread below and it is also not "Up To Date". Please update.

http://forum.spring.io/forum/spring-projects/container/743821-spring-version-matrix-of-components

Thanks,
Vallab

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 28, 2016

Nikolay Gorylenko commented

@christopher

i'm still getting

@ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)

on spring-boot 1.3.3, spring-data-commons:1.12.0.RC1, spring-boot-autoconfigure:1.4.0.BUILD-SNAPSHOT

have

@EnableAutoConfiguration(exclude = ElasticsearchAutoConfiguration.class)
@ComponentScan(
        excludeFilters = @ComponentScan.Filter(classes = ElasticsearchAutoConfiguration.class, type = FilterType.ASSIGNABLE_TYPE)
)

but this does not help to avoid reading of ElasticsearchAutoConfiguration

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Apr 4, 2016

Mihir Pandya commented

When will this be supported through spring boot autoconfigure?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Apr 12, 2016

Utkarsh Mishra commented

Getting this error on including 2.0.1.RELEASE with ES 2.2.0.

Exception in thread "main" java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration.elasticsearchClient
	at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:58)
	at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102)
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:190)
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:148)
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:124)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:318)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
	at com.snapdeal.treasure.search.application.Application.main(Application.java:21)
Caused by: java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)
	at org.springframework.util.Assert.isTrue(Assert.java:65)
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.<init>(OnBeanCondition.java:223)
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:92)
	at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:45)
	... 16 more

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 12, 2016

Adi K commented

I have Spring boot 1.2.3, and ES 2.0. I have the following dependencies in my build.gradle:

dependencies {
compile("org.springframework.boot:spring-boot-autoconfigure:1.2.3.RELEASE")
compile ('org.springframework.data:spring-data-elasticsearch:2.0.0.RELEASE')
}

My configuration class looks as follows:

@Configuration
@EnableElasticsearchRepositories(basePackages = {"org.springframework.data.elasticsearch.repositories.sample",
"org.springframework.data.elasticsearch.config", "com/paraphrase/ps2"}, considerNestedRepositories = true)
public class ElasticSearchClient {
@Autowired
private ElasticSerachConfig esConfig;

private Logger logge = new Loggers()r;
static final String COLON = ":";
static final String COMMA = ",";

private Settings getSetting(){
	/*return ImmutableSettings.settingsBuilder()				
			.put("client.transport.sniff", esConfig.isClusterSniff())
			.put("client.transport.ping_timeout", esConfig.getClientPingTimeout())
			.put("client.transport.nodes_sampler_interval", esConfig.getClientNodesSampleInterval())
			.put("cluster.name", esConfig.getClusterName())
			.build();*/
	return Settings.builder()			
			.put("client.transport.sniff", esConfig.isClusterSniff())
			.put("client.transport.ping_timeout", esConfig.getClientPingTimeout())
			.put("client.transport.nodes_sampler_interval", esConfig.getClientNodesSampleInterval())
			.put("cluster.name", esConfig.getClusterName())
			.build();
}

protected Client buildClient() throws Exception {
	//TransportClient client = new TransportClient(getSetting());
	TransportClient client = TransportClient.builder().settings(getSetting()).build();
	try{		
		
		for (String clusterNode : split(esConfig.getClusteNodes(), COMMA)) {
			String hostName = substringBeforeLast(clusterNode, COLON);
			String port = substringAfterLast(clusterNode, COLON);	
			System.out.println("Available hostnames " + hostName + " port: " + port);
			try{
				client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(hostName), Integer.valueOf(port)));
			}
			catch(Exception ex){
				logger.error("Unable to connect to elastic search node", ex);
				continue;
			}
		}
		client.connectedNodes();
	}
	catch(Exception ex){
		logger.error("Unable to connect to elastic search nodes", ex);
	}
	
	return client;
}

@Bean(name="elasticsearchTemplate")
public ElasticsearchTemplate getElasticSearchTenplate() throws Exception{
		return new ElasticsearchTemplate(buildClient());
}

}

I get the following exception:

java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories.repositoryBaseClass()
at java.lang.reflect.Method.getDefaultValue(Method.java:611)
at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:128)
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:266)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotations(Class.java:3446)
at org.springframework.core.type.StandardAnnotationMetadata.<init>(StandardAnnotationMetadata.java:68)
at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport.getConfigurationSource(AbstractRepositoryConfigurationSourceSupport.java:64)
at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport.registerBeanDefinitions(AbstractRepositoryConfigurationSourceSupport.java:58)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:352)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:101)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 20, 2016

Thiago Locatelli commented

My pom.xml configuration

Spring Boot version: 1.3.5.RELEASE
Spring Data Elasticsearch: 2.0.1.RELEASE (overriding manually since version 1.3.4-RELEASE does not use elasticsearch 2.0+)
Elasticsearch version 2.2.0 (overriding manually since spring-data-elasticsearch brings elasticsearc 1.5.2 to my maven dependencies.

Getting the same issue

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 25, 2016

Jérémie HAREL commented

Hello,
Spring Data Elasticsearch 2.0.2.RELEASE still use the dependency to elasticsearch 1.5.2 in maven configuration.
Is there a problem ?
Then I have the same problem than [#comment-128659]
This issue should be probably reopen.
!http://i.imgur.com/YneAC3p.png!

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 27, 2016

Artur Konczak commented

Hi All
Please take a look at this page, there you will find all the answers :

https://github.com/spring-projects/spring-data-elasticsearch/wiki/Spring-Data-Elasticsearch---Spring-Boot---version-matrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: votes-jira in: core type: dependency-upgrade type: documentation
Projects
None yet
Development

No branches or pull requests

1 participant