Anirban B February 2016

java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setEnvironment

I am getting the below error though the code is very simple:

2016-02-39 15:25:10 DEBUG StandardEnvironment:112 - Initializing new StandardEnvironment
2016-02-39 15:25:10 DEBUG StandardEnvironment:107 - Adding [systemProperties] PropertySource with lowest search precedence
2016-02-39 15:25:10 DEBUG StandardEnvironment:107 - Adding [systemEnvironment] PropertySource with lowest search precedence
2016-02-39 15:25:10 DEBUG StandardEnvironment:116 - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
2016-02-39 15:25:10 INFO  ClassPathXmlApplicationContext:503 - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1ee0005: startup date [Mon Feb 08 15:25:10 IST 2016]; root of context hierarchy
Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setEnvironment(Lorg/springframework/core/env/Environment;)V
    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:86)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.deloitte.batch.client.PersonDaoClient.main(PersonDaoClient.java:28)

Code:

package com.anirban.batch.client;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import org.springframewo        

Answers


KVK February 2016

import the bellow package

import org.springframework.beans.factory.BeanFactory; 
import org.springframework.beans.factory.xml.XmlBeanFactory;

Post Status

Asked in February 2016
Viewed 2,748 times
Voted 5
Answered 1 times

Search




Leave an answer