java - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'batch:job' -
i getting error in applicationcontext.xml batch processing applicationcontext below:
<?xml version='1.0' encoding='utf-8'?> <beans xmlns:batch='http://www.springframework.org/schema/batch' xmlns:xsi='http://www.w3.org/2001/xmlschema-instance' xmlns:context='http://www.springframework.org/schema/context' xmlns:tx='http://www.springframework.org/schema/tx' xmlns='http://www.springframework.org/schema/beans' xsi:schemalocation='http://www.springframework.org/schema/batch http://www.springframework.org/schema/spring-batch.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd'> <import resource="datasource-tx-jpa.xml" /> <!-- can use annotations --> <context:annotation-config /> <!-- package annotated classes --> <context:component-scan base-package='com.anirban.batch' /> <!-- manage transactions annotations --> <tx:annotation-driven /> <bean id="jobrepository" class="org.springframework.batch.core.repository.support.jobrepositoryfactorybean"> <property name="databasetype" value="oracle" /> <property name="datasource" ref="mydatasource" /> <property name="transactionmanager" ref="transactionmanager" /> <property name="isolationlevelforcreate" value="isolation_default" /> </bean> <bean id="joblauncher" class="org.springframework.batch.core.launch.support.simplejoblauncher"> <property name="jobrepository" ref="jobrepository" /> </bean> <!-- xml marshaller --> <bean id="matchmarshaller" class="org.springframework.oxm.castor.castormarshaller"> <property name="mappinglocation" value="oxm-mapping.xml" /> </bean> <!-- batch job: contact import --> <batch:job id="importcontactjob"> <batch:step id="readwritestep"> <batch:tasklet transactionmanager="transactionmanager"> <batch:chunk reader="contactitemreader" processor="contactitemprocessor" writer="contactitemwriter" commit-interval="4" /> </batch:tasklet> </batch:step> <batch:listners> <batch:listner ref="importcontactjoblistener" /> </batch:listners> </batch:job> <bean id="contactitemreader" class="org.springframework.batch.item.xml.staxeventitemreader"> <property name="resource" value="file:///#{jobparameters['contact.xml']" /> <property name="fragmentrootelementname" value="person" /> <property name="unmarshaller" ref="batchmarshaller" /> </bean> <bean id="contactitemwriter" class="org.springframework.batch.item.adapter.itemwriteradapter"> <property name="targetobject" value="persondao" /> <property name="targetmethod" value="save" /> </bean> <bean id="persondao" class="com.anirban.batch.dao.impl.persondaoimpl" /> <!-- <property name="sessionfactory" ref="mysessionfactory"/> </bean> --> <bean id="log4jinitialization" class="org.springframework.beans.factory.config.methodinvokingfactorybean"> <property name="targetclass" value="org.springframework.util.log4jconfigurer" /> <property name="targetmethod" value="initlogging" /> <property name="arguments"> <list> <value>log4j.properties</value> </list> </property> </bean> </beans>
i getting below marker error
multiple annotations found @ line: - start tag of element - cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'batch:job'.
when trying run, throwing below exception:
exception in thread "main" org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 46 in xml document class path resource [applicationcontext.xml] invalid; nested exception org.xml.sax.saxparseexception; linenumber: 46; columnnumber: 35; cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'batch:job'.
and
failed read schema document 'http://www.springframework.org/schema/spring-batch.xsd', because 1) not find document; 2) document not read; 3) root element of document not <xsd:schema>.
pom dependencies:
<dependency> <groupid>org.springframework.batch</groupid> <artifactid>spring-batch-core</artifactid> <version>${spring-batch.version}</version> </dependency> <dependency> <groupid>org.springframework.batch</groupid> <artifactid>spring-batch-infrastructure</artifactid> <version>${spring-batch.version}</version> </dependency>
batch jars available in maven dependencies 1. spring-batch-core-2.2.0.release.jar 2. spring-batch-infrastructure-2.2.0.release.jar
can please help?
Comments
Post a Comment