Hello,
I have some problem writing the xml configuration file for my spring batch test application.
This is the xml file:
The problem is that I receive the following message:Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:batch="http://www.springframework.org/schema/batch" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <import resource="MEMORY-JOBREPOSITORY.xml"/> <!--<import resource="DB-JOBREPOSITORY.xml"/> --> <bean id="tasklet1" class="com.springbatch.test.Tasklet1"/> <bean id="tasklet2" class="com.springbatch.test.Tasklet2"/> <bean id="parameter" class="com.springbatch.test.Parameter" /> <bean id="promotionListener" class="org.springframework.batch.core.listener.ExecutionContextPromotionListener"> <property name="keys" value="keyValue" /> </bean> <job id="passingParametersJob" job-repository="jobRepository"> <step id="step1" next="step2"> <tasklet ref="tasklet1" transaction-manager="jobRepository-transactionManager"> <listeners> <listener ref="promotionListener"/> </listeners> </tasklet> </step> <step id="step2"> <tasklet ref="tasklet2" transaction-manager="jobRepository-transactionManager" /> </step> </job> </beans>
I don't understand if there is some XSD I am missing in the XML header or not.cvc-complex-type.2.4.a: A content starting with element 'job' has been detected. One of the following is expected: '{"http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"]}'.
Anyway, if I write the <job> section as it follows, the error is not going to be shown:
What to do in order to be not obliged to use the batch: namespace before tags in the job section?Code:<batch:job id="passingParametersJob" job-repository="jobRepository"> <batch:step id="step1" next="step2"> <batch:tasklet ref="tasklet1" transaction-manager="jobRepository-transactionManager"> <batch:listeners> <batch:listener ref="promotionListener"/> </batch:listeners> </batch:tasklet> </batch:step> <batch:step id="step2"> <batch:tasklet ref="tasklet2" transaction-manager="jobRepository-transactionManager" /> </batch:step> </batch:job>


Reply With Quote
