使用Java 7的Spring Batch问题

时间:2014-07-09 13:47:43

标签: spring-batch

我在使用JRE 7在Weblogic 12c中运行Spring Batch作业时遇到问题。

我有以下工作和步骤声明。

<bean id="taskletStep" abstract="true"
    class="org.springframework.batch.core.step.tasklet.TaskletStep">
    <property name="jobRepository" ref="jobRepository" />
    <property name="transactionManager" ref="transactionManager" />
</bean>
<bean id="doInit_EDIBase" class="tos.demand.edi.batch.EdiApplyInitBaseTasklet"
    abstract="true" />
<bean id="doInit_EDIApply"
    class="tos.demand.order.edi.tasklet.CreateLansideOrderCommonInitTasklet"
    parent="doInit_EDIBase" />
<bean id="doInit_CreateLandsideOrder"
    class="tos.demand.order.edi.tasklet.CreateLandsideOrderSpecializedInitTasklet" />
        class="tos.appinfra.batchprocessing.jobexecutionmonitor.JobExecutionLifecycleAgent" />
<batch:job id="CreateLandsideOrderBatchJobCoparn" job-repository="jobRepository">
    <batch:description>CreateLandsideOrderBatchJobCoparn</batch:description>
    <batch:step id="doInit_Apply" parent="taskletStep" next="doInit_CreateOrder">
        <batch:tasklet ref="doInit_EDIApply" />
    </batch:step>
     <batch:step id="doInit_CreateOrder" parent="taskletStep">
        <batch:tasklet ref="doInit_CreateLandsideOrder" />
    </batch:step>
    <batch:listeners>
        <batch:listener ref="batchjobExecutionListener" />
    </batch:listeners>
</batch:job>

当我运行作业CreateLandsideOrderBatchJobCoparn时,第一步“doInit_Apply”成功运行,但下一步“doInit_CreateOrder”永远不会启动。我在Spring DB(批处理作业实例表)中得到以下异常

org.springframework.batch.core.JobExecutionException: Flow execution ended unexpectedly
at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:141)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:301)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run   (SimpleJobLauncher.java:134)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:127)
at tos.appinfra.batchprocessing.domain.JobControllServiceImpl.submitJobToSpring(JobControllServiceImpl.java:164).

.........................

当我删除步骤“doInit_Apply”并仅保留“doInit_CreateOrder”时,则“doInit_CreateOrder”成功执行。只有条件步骤执行失败。

尽管在log4j.properties中添加了log4j.logger.org.springframework.batch = debug,但我没有收到Spring Batch日志信息。

0 个答案:

没有答案