title: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setEnvironment
body: <p>I am getting the below error though the code is very simple:</p>
  
  <pre><code>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.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)
      at com.deloitte.batch.client.PersonDaoClient.main(PersonDaoClient.java:28)
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>package com.anirban.batch.client;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import org.apache.log4j.Logger;
  
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.support.ClassPathXmlApplicationContext;
  
  import com.anirban.batch.dao.PersonDao;
  import com.anirban.batch.domain.Person;
  
  public class PersonDaoClient {
  
      static Logger log = Logger.getLogger(PersonDaoClient.class.getName());
  
      public static void main(String[] args) {
          long personId=2;
          ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
          PersonDao personDao = (PersonDao) ctx.getBean(PersonDao.class);
  
          Person person = personDao.getPersonById(personId); 
          System.out.println(person);
          System.out.println();
  
          List&lt;Person&gt; personList = (List&lt;Person&gt;) personDao.getPersonList();
          for(Person p : personList){
            System.out.print(p.getPersonId()+"  ");
            System.out.print(p.getFirstName()+"  ");
            System.out.println(p.getLastName());
          }
          personList = new ArrayList&lt;Person&gt;();
          personList.add(new Person("Abc", "Def"));
          personList.add(new Person("Ijk", "Lmn"));
          personList.add(new Person("Opq", "Rst"));
  
          personDao.save(personList);
      }
  }
  </code></pre>
  
  <p>Dependencies as below:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;spring.version&gt;3.1.3.RELEASE&lt;/spring.version&gt;
      &lt;spring-batch.version&gt;2.1.9.RELEASE&lt;/spring-batch.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;3.8.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-oxm&lt;/artifactId&gt;
          &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
          &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-aspects&lt;/artifactId&gt;
          &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
          &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
          &lt;version&gt;1.6.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
          &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
          &lt;version&gt;1.4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
          &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.batch&lt;/groupId&gt;
          &lt;artifactId&gt;spring-batch-core&lt;/artifactId&gt;
          &lt;version&gt;${spring-batch.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.batch&lt;/groupId&gt;
          &lt;artifactId&gt;spring-batch-infrastructure&lt;/artifactId&gt;
          &lt;version&gt;${spring-batch.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.castor&lt;/groupId&gt;
          &lt;artifactId&gt;castor-xml&lt;/artifactId&gt;
          &lt;version&gt;1.3.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Hibernate dependencies --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
          &lt;version&gt;4.1.8.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;4.1.8.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.oracle&lt;/groupId&gt;
          &lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
          &lt;version&gt;11.2.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;version&gt;1.5.10&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>As I am working with spring batch there is some batch dependencies.
  Can anyone please help. Probably I am missing something basic but cant find out.</p>