I am trying to load an XML file consisting of elasticsearch properties. In the jave spring web application, I am trying to load the xml file using the below line -
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
applicationContext.xml is located under src/main/reosurces.
Below errors I am getting when I run the application from UI.
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getEnvironment()Lorg/springframework/core/env/Environment;
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getEnvironment()Lorg/springframework/core/env/Environment;
Sorry, I was trying to send one line containing <> brackets, it is not posted. Therefore, I had to post so many times. I removed the brackets and posting it.
elasticsearch:repositories base-package="com.pn.daos.elasticsearch.report"
I am using
spring-data-elasticsearch-1.3.2.RELEASE.jar
spring-data-commons-1.11.2.RELEASE.jar
And all other spring jars like spring-beans, spring-context, spring-core, ...etc of 4.0.2 version.
Are these versions compatible with spring-data-elasticsearch ?
I'd try to locate where class org.springframework.beans.factory.xml.XmlReaderContext lives and if the method getEnvironment() method exists in this jar.
But I think you'd better ask this in Spring forums.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.