Announcement Announcement Module
Collapse
No announcement yet.
Batch job getting executed repeatedly Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch job getting executed repeatedly

    Hi,
    Batch Job is getting executed repeatedly. Not so sure what is wrong here..
    launch-context.xml is:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:batch="http://www.springframework.org/schema/batch"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns="http://www.springframework.org/schema/p"
    xsi:schemaLocation="
    http://www.springframework.org/schema/batch http://www.springframework.org/schem...-batch-2.1.xsd
    http://www.springframework.org/schema/jdbc http://www.springframework.org/schem...g-jdbc-3.0.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <contextroperty-placeholder location="classpath:batch-timesten.properties" />

    <import resource="data-source-context.xml" />

    <bean id="jobLauncher"
    class="org.springframework.batch.core.launch.suppo rt.SimpleJobLauncher">
    <property name="jobRepository" ref="jobRepository" />
    </bean>

    <batch:job-repository id="jobRepository" table-prefix="DG.BATCH_"/>

    <bean id="jobExplorer"
    class="org.springframework.batch.core.explore.supp ort.JobExplorerFactoryBean"
    p:dataSource-ref="dataSource">
    </bean>

    </beans>


    configjob.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns="http://www.springframework.org/schema/p"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-2.0.xsd
    http://www.springframework.org/schema/batch http://www.springframework.org/schem...-batch-2.1.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">



    <job id="configJob" xmlns="http://www.springframework.org/schema/batch">
    <step id="step1" xmlns="http://www.springframework.org/schema/batch">
    <tasklet>
    <chunk reader="itemReader" processor="itemProcessor" writer="itemWriter"
    commit-interval="2">
    <!-- <skippable-exception-classes>
    <include class="java.lang.RuntimeException" />
    </skippable-exception-classes> -->
    </chunk>
    </tasklet>
    </step>
    </job>

    <bean id="itemReader" class="com.test.bulkfw.config.KnConfigBatchReader" >
    </bean>

    <bean id="itemProcessor" class="com.test.bulkfw.config.KnConfigBatchProcess or">
    </bean>

    <bean id="itemWriter" class="com.test.bulkfw.config.KnConfigBatchWriter" >
    </bean>

    </beans>

    Can any one help in wat is being configured as wrong?

  • #2
    Is the job configJob completing successfully or is a retry taking place?

    Jeff

    Comment


    • #3
      Config Job is not getting into COMPLETED stage.
      I figured it out.. As long as the Reader is able to read and push the data, the job will not get into COMPLETED state.
      Once i set the read data to null, The job has been set to COMPLETED job.

      Thanks

      Comment

      Working...
      X