BATCH-1387: fix some errors and check the effect of new bundle in STS

This commit is contained in:
dsyer
2010-01-04 12:42:08 +00:00
parent 506cfcf8ee
commit bf1a83b8d4
8 changed files with 240 additions and 240 deletions

View File

@@ -155,7 +155,7 @@ public abstract class AbstractFlowParser extends AbstractSingleBeanDefinitionPar
String flowName = (String) builder.getRawBeanDefinition().getAttribute("flowName");
if (!stepExists && !StringUtils.hasText(element.getAttribute("parent"))) {
parserContext.getReaderContext().error("The flow [" + flowName + "] must contain at least one step",
parserContext.getReaderContext().error("The flow [" + flowName + "] must contain at least one step, flow or split",
element);
}

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job">
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job">
<step id="s1" parent="step1">
<end on="COMPLETED"/>
<fail on="COMPLETED"/>
</step>
</job>
</step>
</job>
</beans:beans>

View File

@@ -1,32 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job1">
<step id="s1" parent="step1" next="job1.flow" />
<step id="job1.flow" next="s4">
<flow parent="flow" />
</step>
<step id="s4" parent="step4" />
</job>
<job id="job2">
<step id="job2.s1" parent="step1" next="job2.flow" />
<step id="job2.flow" parent="flow.step" next="job2.s4" />
<step id="job2.s4" parent="step4" />
</job>
<flow id="flow" abstract="true">
<step id="s2" parent="step2" next="s3" />
<step id="s3" parent="step3" />
</flow>
<step id="flow.step" abstract="true">
<flow parent="flow" />
</step>
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job1">
<step id="s1" parent="step1" next="job1.flow" />
<step id="job1.flow" next="s4">
<flow parent="flow" />
</step>
<step id="s4" parent="step4" />
</job>
<job id="job2">
<step id="job2.s1" parent="step1" next="job2.flow" />
<step id="job2.flow" parent="flow.step" next="job2.s4" />
<step id="job2.s4" parent="step4" />
</job>
<flow id="flow" abstract="true">
<step id="s2" parent="step2" next="s3" />
<step id="s3" parent="step3" />
</flow>
<step id="flow.step" abstract="true">
<flow parent="flow" />
</step>
</beans:beans>

View File

@@ -92,8 +92,8 @@
</job-listener>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="dummyJobRepository"
</beans:bean>
<beans:bean id="dummyJobRepository"
class="org.springframework.batch.core.configuration.xml.DummyJobRepository" />
<job id="listenerClearingJob" parent="baseJob">

View File

@@ -1,38 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job1">
<step id="s1" parent="step1" next="job1.flow" />
<step id="job1.flow" next="s4">
<job ref="flow" />
</step>
<step id="s4" parent="step4" />
</job>
<job id="job2">
<step id="job2.s1" parent="step1" next="job2.flow" />
<step id="job2.flow" parent="flow.step" next="job2.s4" />
<step id="job2.s4" parent="step4" />
</job>
<job id="flow">
<step id="s2" parent="step2" next="s3" />
<step id="s3" parent="step3" />
</job>
<step id="flow.step" abstract="true">
<job ref="flow" job-launcher="jobLauncher" job-parameters-extractor="jobParametersExtractor"/>
</step>
<beans:bean id="jobParametersExtractor" class="org.springframework.batch.core.step.job.DefaultJobParametersExtractor"/>
<beans:bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<beans:property name="jobRepository" ref="jobRepository"/>
</beans:bean>
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job1">
<step id="s1" parent="step1" next="job1.flow" />
<step id="job1.flow" next="s4">
<job ref="flow" />
</step>
<step id="s4" parent="step4" />
</job>
<job id="job2">
<step id="job2.s1" parent="step1" next="job2.flow" />
<step id="job2.flow" parent="flow.step" next="job2.s4" />
<step id="job2.s4" parent="step4" />
</job>
<job id="flow">
<step id="s2" parent="step2" next="s3" />
<step id="s3" parent="step3" />
</job>
<step id="flow.step" abstract="true">
<job ref="flow" job-launcher="jobLauncher" job-parameters-extractor="jobParametersExtractor"/>
</step>
<beans:bean id="jobParametersExtractor" class="org.springframework.batch.core.step.job.DefaultJobParametersExtractor"/>
<beans:bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<beans:property name="jobRepository" ref="jobRepository"/>
</beans:bean>
</beans:beans>

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job">
<step id="s1" parent="step1" next="s3">
<next on="COMPLETED WITH SKIPS" to="s2" />
</step>
<step id="s2" parent="step2"/>
<step id="s3" parent="step3"/>
</job>
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job">
<step id="s1" parent="step1" next="s3">
<next on="COMPLETED WITH SKIPS" to="s2" />
</step>
<step id="s2" parent="step2"/>
<step id="s3" parent="step3"/>
</job>
</beans:beans>

View File

@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job1">
<step id="s1">
<partition step="step1" partitioner="partitioner">
<handler task-executor="taskExecutor" grid-size="2" />
</partition>
</step>
</job>
<job id="job2">
<step id="s2" next="s3">
<partition step="step1" handler="handler" partitioner="partitioner"/>
</step>
<step id="s3" parent="step2"/>
</job>
<bean id="handler"
class="org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler"
xmlns="http://www.springframework.org/schema/beans">
<property name="step" ref="step1"/>
</bean>
<beans:bean id="taskExecutor"
class="org.springframework.core.task.SimpleAsyncTaskExecutor" />
<beans:bean id="partitioner"
class="org.springframework.batch.core.partition.support.SimplePartitioner" />
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<beans:import resource="common-context.xml" />
<job id="job1">
<step id="s1">
<partition step="step1" partitioner="partitioner">
<handler task-executor="taskExecutor" grid-size="2" />
</partition>
</step>
</job>
<job id="job2">
<step id="s2" next="s3">
<partition step="step1" handler="handler" partitioner="partitioner"/>
</step>
<step id="s3" parent="step2"/>
</job>
<bean id="handler"
class="org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler"
xmlns="http://www.springframework.org/schema/beans">
<property name="step" ref="step1"/>
</bean>
<beans:bean id="taskExecutor"
class="org.springframework.core.task.SimpleAsyncTaskExecutor" />
<beans:bean id="partitioner"
class="org.springframework.batch.core.partition.support.SimplePartitioner" />
</beans:beans>

View File

@@ -1,14 +1,14 @@
<?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:util="http://www.springframework.org/schema/util"
<?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:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<job id="skipJob" incrementer="incrementer" xmlns="http://www.springframework.org/schema/batch">
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<job id="skipJob" incrementer="incrementer" xmlns="http://www.springframework.org/schema/batch">
<step id="step1" parent="baseStep">
<tasklet>
<tasklet>
<chunk reader="fileItemReader" processor="tradeProcessor" writer="tradeWriter" commit-interval="3" skip-limit="10">
<skippable-exception-classes>
<include class="org.springframework.batch.item.file.FlatFileParseException" />
@@ -18,119 +18,119 @@
</tasklet>
<next on="*" to="step2" />
<next on="COMPLETED WITH SKIPS" to="errorPrint1" />
<next on="COMPLETED WITH SKIPS" to="errorPrint1" />
<fail on="FAILED" exit-code="FAILED" />
</step>
<step id="errorPrint1" next="step2">
<tasklet ref="errorLogTasklet" />
</step>
<step id="step2" parent="baseStep" next="skipCheckingDecision">
<tasklet>
<chunk reader="tradeSqlItemReader" processor="tradeProcessorFailure" writer="itemTrackingWriter"
commit-interval="2" skip-limit="10">
<skippable-exception-classes merge="true">
<include class="org.springframework.batch.item.validator.ValidationException" />
<include class="java.io.IOException" />
</skippable-exception-classes>
</chunk>
<no-rollback-exception-classes>
<include class="org.springframework.batch.item.validator.ValidationException" />
</no-rollback-exception-classes>
</tasklet>
</step>
<decision id="skipCheckingDecision" decider="skipCheckingDecider">
</step>
<step id="step2" parent="baseStep" next="skipCheckingDecision">
<tasklet>
<chunk reader="tradeSqlItemReader" processor="tradeProcessorFailure" writer="itemTrackingWriter"
commit-interval="2" skip-limit="10">
<skippable-exception-classes merge="true">
<include class="org.springframework.batch.item.validator.ValidationException" />
<include class="java.io.IOException" />
</skippable-exception-classes>
</chunk>
<no-rollback-exception-classes>
<include class="org.springframework.batch.item.validator.ValidationException" />
</no-rollback-exception-classes>
</tasklet>
</step>
<decision id="skipCheckingDecision" decider="skipCheckingDecider">
<end on="*" />
<next on="COMPLETED WITH SKIPS" to="errorPrint2" />
<next on="COMPLETED WITH SKIPS" to="errorPrint2" />
<fail on="FAILED" exit-code="FAILED" />
</decision>
</decision>
<step id="errorPrint2">
<tasklet ref="errorLogTasklet" />
</step>
</step>
</job>
<step id="baseStep" abstract="true" xmlns="http://www.springframework.org/schema/batch">
<tasklet>
<listeners>
<listener>
<bean class="org.springframework.batch.sample.common.SkipCheckingListener" xmlns="http://www.springframework.org/schema/beans" />
<listener>
<bean class="org.springframework.batch.sample.common.SkipCheckingListener" xmlns="http://www.springframework.org/schema/beans" />
</listener>
<listener>
<bean class="org.springframework.batch.core.listener.ExecutionContextPromotionListener" xmlns="http://www.springframework.org/schema/beans">
<property name="keys">
<list>
<value>stepName</value>
<util:constant static-field="org.springframework.batch.sample.domain.trade.internal.TradeWriter.TOTAL_AMOUNT_KEY" />
</list>
</property>
</bean>
<listener>
<bean class="org.springframework.batch.core.listener.ExecutionContextPromotionListener" xmlns="http://www.springframework.org/schema/beans">
<property name="keys">
<list>
<value>stepName</value>
<util:constant static-field="org.springframework.batch.sample.domain.trade.internal.TradeWriter.TOTAL_AMOUNT_KEY" />
</list>
</property>
</bean>
</listener>
</listeners>
</tasklet>
</step>
<bean id="fileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
<property name="resource" value="classpath:/data/skipJob/input/input#{jobParameters['run.id']}.txt" />
<property name="lineMapper">
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
<property name="lineTokenizer">
<bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
<property name="names" value="ISIN, Quantity, Price, Customer" />
</bean>
</property>
<property name="fieldSetMapper">
<bean class="org.springframework.batch.sample.domain.trade.internal.TradeFieldSetMapper" />
</property>
</bean>
</property>
</bean>
<bean id="tradeProcessor" class="org.springframework.batch.sample.domain.trade.internal.TradeProcessor" scope="step"/>
<bean id="tradeProcessorFailure" class="org.springframework.batch.sample.domain.trade.internal.TradeProcessor" scope="step">
<property name="validationFailure" value="7" />
</bean>
<bean id="tradeWriter" class="org.springframework.batch.sample.domain.trade.internal.TradeWriter" scope="step">
<property name="dao">
<bean class="org.springframework.batch.sample.domain.trade.internal.JdbcTradeDao">
<property name="dataSource" ref="dataSource" />
<property name="incrementer">
<bean parent="incrementerParent">
<property name="incrementerName" value="TRADE_SEQ" />
</bean>
</property>
</bean>
</property>
<property name="failingCustomers">
<list>
<value>customer6</value>
</list>
</property>
</bean>
<bean id="itemTrackingWriter" class="org.springframework.batch.sample.domain.trade.internal.ItemTrackingTradeItemWriter" scope="step">
<property name="writeFailureISIN" value="UK21341EAH47" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="tradeSqlItemReader" class="org.springframework.batch.item.database.JdbcCursorItemReader" scope="step">
<property name="dataSource" ref="dataSource" />
<property name="sql" value="SELECT isin, quantity, price, customer, id, version from TRADE" />
<property name="rowMapper">
<bean class="org.springframework.batch.sample.domain.trade.internal.TradeRowMapper" />
</property>
</bean>
<bean id="errorLogTasklet" class="org.springframework.batch.sample.common.ErrorLogTasklet" scope="step">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="skipCheckingDecider" class="org.springframework.batch.sample.common.SkipCheckingDecider" />
<bean id="incrementer" class="org.springframework.batch.core.launch.support.RunIdIncrementer" />
</beans>
<bean id="fileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
<property name="resource" value="classpath:/data/skipJob/input/input#{jobParameters['run.id']}.txt" />
<property name="lineMapper">
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
<property name="lineTokenizer">
<bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
<property name="names" value="ISIN, Quantity, Price, Customer" />
</bean>
</property>
<property name="fieldSetMapper">
<bean class="org.springframework.batch.sample.domain.trade.internal.TradeFieldSetMapper" />
</property>
</bean>
</property>
</bean>
<bean id="tradeProcessor" class="org.springframework.batch.sample.domain.trade.internal.TradeProcessor" scope="step"/>
<bean id="tradeProcessorFailure" class="org.springframework.batch.sample.domain.trade.internal.TradeProcessor" scope="step">
<property name="validationFailure" value="7" />
</bean>
<bean id="tradeWriter" class="org.springframework.batch.sample.domain.trade.internal.TradeWriter" scope="step">
<property name="dao">
<bean class="org.springframework.batch.sample.domain.trade.internal.JdbcTradeDao">
<property name="dataSource" ref="dataSource" />
<property name="incrementer">
<bean parent="incrementerParent">
<property name="incrementerName" value="TRADE_SEQ" />
</bean>
</property>
</bean>
</property>
<property name="failingCustomers">
<list>
<value>customer6</value>
</list>
</property>
</bean>
<bean id="itemTrackingWriter" class="org.springframework.batch.sample.domain.trade.internal.ItemTrackingTradeItemWriter" scope="step">
<property name="writeFailureISIN" value="UK21341EAH47" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="tradeSqlItemReader" class="org.springframework.batch.item.database.JdbcCursorItemReader" scope="step">
<property name="dataSource" ref="dataSource" />
<property name="sql" value="SELECT isin, quantity, price, customer, id, version from TRADE" />
<property name="rowMapper">
<bean class="org.springframework.batch.sample.domain.trade.internal.TradeRowMapper" />
</property>
</bean>
<bean id="errorLogTasklet" class="org.springframework.batch.sample.common.ErrorLogTasklet" scope="step">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="skipCheckingDecider" class="org.springframework.batch.sample.common.SkipCheckingDecider" />
<bean id="incrementer" class="org.springframework.batch.core.launch.support.RunIdIncrementer" />
</beans>