I'm using:
- Spring core 4.3.7
- Spring-data-elasticsearch 3.0.9 RELEASE
- ES: "version": "5.5.0"
- org.elasticsearch.client:rest:5.5.0 and transport 5.5.0
- Spring-data-commons 1.12.8.RELEASE
Created IAuditElasticRepository.java with empty interface:
public interface IAuditElasticRepository extends ElasticsearchRepository<AuditDocument, String> { }
Created an ch-elastic.xml configuration:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="...Many needed schemas.." <context:spring-configured /> <context:annotation-config /> <elasticsearch:repositories base-package="com.**.ch.db.elasticsearch" /> </beans>
Autowired it in my Manager class:
@Autowired private IAuditElasticRepository elasticRepository;
And there is a parent xml called ch-db.xml which imports this ch-elastic.xml to it.
I have read latests posts about abstractMethodError, but couldn't find anything helpful. is it related to my Spring Core Version?
Stack trace:
2018-07-30 07:02:25,472 INFOjava.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; Caused by: java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/ch-db.xml] Offending resource: class path resource [META-INF/ch-ws.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml] Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70) Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml] Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414) Caused by: java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; 2018-07-30 07:02:25,650 WARN [org.eclipse.jetty.util.component.AbstractLifeCycle] - FAILED o.e.j.w.WebAppContext{/ws,file:/C:/workspaces/ConnectedHome/Foundation/CH/main/ws/src/main/resources/webapp/}: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/ch-org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/ch-db.xml] Offending resource: class path resource [META-INF/ch-ws.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml] Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String; at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: Caused by: java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
- What could be the errors? this works well with spring-boot
- If any version change is needed- what would you recommend?
- Should I keep working with spring-data or switch to java REST high level?
Thanks!!