Announcement Announcement Module
Collapse
No announcement yet.
The @AfterWrite is not called for scope="step" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • The @AfterWrite is not called for scope="step"

    Hello,

    I have following problem - the @AfterWrite is not called for bean with scope="step". I'm using Spring Batch 2.0.0.RC1

    The listener is registered and method is being called when I remove scope="step" from bean definition.

    Regards,
    Igor

  • #2
    Can you paste your configuration?

    Comment


    • #3
      job

      Here it is.
      HTML Code:
      	<job id="Kofax_AR_INV_Job" restartable="true" >
      	    
      		<step id="load" next="moveForRetry">
      			 <tasklet reader="Kofax_AR_INVItemReader" writer="Kofax_AR_INVItemWriter" commit-interval="${job.commit.interval}" skip-limit="10">
      			               
                       <skippable-exception-classes>
      			         org.springframework.dao.DataIntegrityViolationException
      			     </skippable-exception-classes>
      
      			</tasklet>               
      		    <listeners>
      		    	<listener ref="stepListener"/>
      		    </listeners>
      		</step>
      	 <step id="moveForRetry" tasklet="retryMovingTasklet" next="moveToComplete"/>
      	 <step id="moveToComplete" tasklet="compMovingTasklet"/>
      		
      
      	</job>
        <beans:bean id="stepListener" scope="step"
              class="com.cce.filenet.reports.listeners.LoadListener" >
          <beans:property name="failedLogName" value="retry"/>
          <beans:property name="files" ref="filesState"/>
      	<beans:property name="jobId" value="#{jobParameters[job.id]}" />
        </beans:bean>
      There's also following definition in main context file

      HTML Code:
      <bean class="org.springframework.batch.core.scope.StepScope" />
      Btw, late binding doesn't work for me either
      I also have PropertyPlaceholderConfigurer defined but even when I removed it - late binding still didn't kick in.

      HTML Code:
      	<beans:bean id="job2Properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      		<beans:property name="properties">
      			<beans:value>
      				job.commit.interval=5
      				files.list.init.size=15
      				skip.limit=10
      				input.dir=C:\\Projects\\CocaCola\\ReportUpdater\\bin\\data\\output\\Kofax_AR_INV
      				temp.dir=C:/Projects/CocaCola/ReportUpdater/bin/test-dir/Kofax_AR_INV
      				retry.dir=C:/Projects/CocaCola/ReportUpdater/bin/data/retry/Kofax_AR_INV
      				comp.dir=C:/Projects/CocaCola/ReportUpdater/bin/data/comp/Kofax_AR_INV
      			</beans:value>
      		</beans:property>
      		<beans:property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
      		<beans:property name="ignoreUnresolvablePlaceholders" value="true" />
      		<beans:property name="order" value="1" />
      	</beans:bean>

      Comment


      • #4
        I was able to duplicate the problem and an issue has been created to track it: http://jira.springframework.org/browse/BATCH-1164

        Comment

        Working...
        X