I have created one spring batch project. It executes perfectly as Java application. After that I created a jar file using maven build. But when I tried to run the jar file, the below exception is thrown:
=================================================================================
Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 142 in XML document from class path resource [SICBatchFile.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'job'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'job'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
... 14 more
=================================================================================
It's getting through the mail class. But when reading the xml, it throws this exception. Below is the xml part:
<beans:beans
xmlns="ht tp: / /www.springframework.org/schema/batch"
xmlns:beans="ht tp: / /www.springframework.org/schema/beans"
xmlns:aop="ht tp: / /www.springframework.org/schema/aop"
xmlns:tx="ht tp: / /www.springframework.org/schema/tx" xmlns:p="ht tp: / /www.springframework.org/schema/p"
xmlns:xsi="ht tp :/ /www.w3.org/2001/XMLSchema-instance" xmlns:util="ht tp: / /www.springframework.org/schema/util"
xsi:schemaLocation="ht tp: / /www.springframework.org/schema/beans ht tp: / /www.springframework.org/schema/beans/spring-beans-2.0.xsd
ht tp: / /www.springframework.org/schema/batch ht tp: / /www.springframework.org/schema/batch/spring-batch-2.0.xsd
ht tp: / /www.springframework.org/schema/aop ht tp: / /www.springframework.org/schema/aop/spring-aop-2.0.xsd
ht tp: / /www.springframework.org/schema/tx
ht tp: / /www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<job id="sicProcessorJob" job-repository="jobRepository">
<step id="step1">
<tasklet transaction-manager="jobRepository-transactionManager">
<chunk reader="sicFileItemReader" processor="sicProcessor"
writer="sicFileItemWriter" commit-interval="3">
<streams>
<stream ref="sicFileItemWriter1"/>
<stream ref="sicFileItemWriter2" />
</streams>
</chunk>
</tasklet>
</step>
<listeners>
<listener ref="jobListener" />
</listeners>
</job>
IDE: Eclipse