title: Spring Batch 'beanName' must not be empty
body: <p>In my simple <code>Spring Batch</code> application, I get the error <code>'beanName' must not be empty</code>.
  I don't know, what is missing in spring configuration.</p>
  
  <p>spring-beans.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:faces="http://www.springframework.org/schema/faces"
      xmlns:int-security="http://www.springframework.org/schema/integration/security"
      xmlns:tx="http://www.springframework.org/schema/tx" 
      xmlns:sec="http://www.springframework.org/schema/security"
      xmlns:util="http://www.springframework.org/schema/util"
      xmlns:batch="http://www.springframework.org/schema/batch"
      xmlns:task="http://www.springframework.org/schema/task" 
      xsi:schemaLocation="http://www.springframework.org/schema/integration/security http://www.springframework.org/schema/integration/security/spring-integration-security-2.0.xsd
          http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
          http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
          http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.0.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
          http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
          http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.2.xsd
          http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd"&gt;
  
      &lt;context:annotation-config/&gt;    
      &lt;context:component-scan base-package="com.java.batch"/&gt;
      &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;
  
      &lt;!-- stored job-meta in memory --&gt;
      &lt;bean id="jobRepository"
          class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"&gt;
          &lt;property name="transactionManager" ref="transactionManager" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="transactionManager"
          class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" /&gt;
  
      &lt;bean id="jobLauncher"
          class="org.springframework.batch.core.launch.support.SimpleJobLauncher"&gt;
          &lt;property name="jobRepository" ref="jobRepository" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="report" class="com.java.batch.Report" scope="prototype" /&gt;
  
      &lt;bean id="customWriter" class="com.java.batch.CustomWriter" /&gt;
  
      &lt;batch:job id="reportJob"&gt;
          &lt;batch:step id="step1"&gt;
              &lt;batch:tasklet&gt;
                  &lt;batch:chunk reader="cvsFileItemReader" writer="customWriter"
                      commit-interval="10"&gt;
                  &lt;/batch:chunk&gt;
              &lt;/batch:tasklet&gt;
          &lt;/batch:step&gt;
      &lt;/batch:job&gt;
  
      &lt;bean id="cvsFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader"&gt;
  
          &lt;!-- Read a csv file --&gt;
          &lt;property name="resource" value="classpath:report.csv" /&gt;
  
          &lt;property name="lineMapper"&gt;
              &lt;bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper"&gt;
                  &lt;property name="lineTokenizer"&gt;
                      &lt;bean
                          class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer"&gt;
                          &lt;property name="names" value="id,impressions" /&gt;
                      &lt;/bean&gt;
                  &lt;/property&gt;
                  &lt;property name="fieldSetMapper"&gt;
                      &lt;bean
                          class="org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper"&gt;
                          &lt;property name="prototypeBeanName" value="report" /&gt;
                      &lt;/bean&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
  
      &lt;/bean&gt;
  
      &lt;bean id="runScheduler" class="com.java.batch.RunScheduler" /&gt;
  
      &lt;!-- Run every 5 seconds --&gt;
      &lt;task:scheduled-tasks&gt;
          &lt;!-- &lt;task:scheduled ref="runScheduler" method="run" fixed-delay="5000" 
              /&gt; --&gt;
          &lt;task:scheduled ref="runScheduler" method="run"
              cron="*/5 * * * * *" /&gt;
      &lt;/task:scheduled-tasks&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>project structure   </p>
  
  <p><img src="https://i.stack.imgur.com/U55sd.png" alt="enter image description here"></p>
  
  <p>error</p>
  
  <pre><code>Dec 17, 2013 2:00:32 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
  INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@145d068: startup date [Tue Dec 17 14:00:32 MMT 2013]; root of context hierarchy
  Dec 17, 2013 2:00:32 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  INFO: Loading XML bean definitions from class path resource [spring-beans.xml]
  Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-beans.x
  ml]; nested exception is java.lang.IllegalArgumentException: 'beanName' must not be empty
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
      at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
      at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
      at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
      at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
      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.java.batch.Test.main(Test.java:8)
  Caused by: java.lang.IllegalArgumentException: 'beanName' must not be empty
      at org.springframework.util.Assert.hasText(Assert.java:162)
      at org.springframework.beans.factory.config.RuntimeBeanReference.&lt;init&gt;(RuntimeBeanReference.java:58)
      at org.springframework.beans.factory.config.RuntimeBeanReference.&lt;init&gt;(RuntimeBeanReference.java:46)
      at org.springframework.batch.core.configuration.xml.AbstractStepParser.setUpBeanDefinitionForTaskletStep(AbstractStepParser.java:155)
      at org.springframework.batch.core.configuration.xml.AbstractStepParser.parseTasklet(AbstractStepParser.java:133)
      at org.springframework.batch.core.configuration.xml.AbstractStepParser.parseStep(AbstractStepParser.java:85)
      at org.springframework.batch.core.configuration.xml.InlineStepParser.parse(InlineStepParser.java:59)
      at org.springframework.batch.core.configuration.xml.FlowParser.doParse(FlowParser.java:119)
      at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:85)
      at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59)
      at org.springframework.batch.core.configuration.xml.JobParser.doParse(JobParser.java:95)
      at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:85)
      at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59)
      at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)
      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:195)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
      ... 14 more
  </code></pre>