Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Element 'skippable-exception-classes' must have no element

  1. #1

    Default Element 'skippable-exception-classes' must have no element

    Hi All,

    I'm newbie to Spring Batch Processing. Trying to configure <skippable-exception-classes> in the job, but i am facing following exception. We are using spring batch 2.0

    Caused by: org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 19 in XML document from class path resource [indexJobContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.2: Element 'skippable-exception-classes' must have no element [children], and the value must be valid.
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:404)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:342)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:310)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
    at

    Please help if anyone has faced issue prior.

    Thanks,
    Rakesh.

  2. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    Looks like probably a simple error in your XML. If you post it someone might be able to spot it. Or your editor should tell you if it has validation built in.

  3. #3
    Join Date
    Jul 2011
    Posts
    6

    Default

    I also got the same error. The step configuration is as follows

    Code:
    		<batch:step id="loadExpenseDescr"> 
    			<batch:tasklet transaction-manager="ora-transactionManager" >
    				<batch:chunk reader="expenseDescrDBReader" processor="expenseDescrProcessor" writer="expenseDescrDBWriter"  commit-interval="10" skip-limit="100000">
    				         <batch:skippable-exception-classes>
    				         	<batch:include class="org.springframework.dao.DuplicateKeyException"/>
    				         </batch:skippable-exception-classes>	
    				</batch:chunk>
    </batch:tasklet>
    </batch:step>

  4. #4
    Join Date
    Jul 2011
    Posts
    6

    Default

    My stupid...

    I was referring to beans & batch 2.0 schema locations.

  5. #5
    Join Date
    Aug 2011
    Posts
    16

    Default

    Hey Man , if you got the answer please let me know asap... I need it...I am also facing the same issue , even if you change the xsd from 2.0 to 2.1 it wont work...

  6. #6
    Join Date
    Jul 2011
    Posts
    6

    Default

    This is working for me

    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.0.xsd
    		http://www.springframework.org/schema/tx 
    		http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

  7. #7
    Join Date
    Aug 2011
    Posts
    16

    Default What do you mean by this tag

    transaction-manager="ora-transactionManager"

  8. #8
    Join Date
    Aug 2011
    Posts
    16

    Default

    In my case it seems to me that skippable-exception-classes does not work. i tried with your code but i am getting the same exception again and again if i am having duplicate rows.

  9. #9
    Join Date
    Jul 2011
    Posts
    6

    Default

    Please port your xml files.

    Regards
    AN

  10. #10
    Join Date
    Aug 2011
    Posts
    16

    Default

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns="http://www.springframework.org/schema/p"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schem...spring-aop.xsd
    http://www.springframework.org/schema/batch http://www.springframework.org/schem...-batch-2.1.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">



    <import resource="classpath:conf/vpb-context.xml"/>

    <job id="paymentRecordLoadJob" xmlns="http://www.springframework.org/schema/batch">
    <step id="paymentRecordLoad">
    <tasklet transaction-manager="transactionManager" >
    <chunk reader="paymentRecordReader" writer="paymentRecordWriter"
    commit-interval="2" skip-limit="100000">
    <skippable-exception-classes>
    <include class="org.springframework.dao.DuplicateKeyExcepti on"/>
    </skippable-exception-classes>
    </chunk>
    </tasklet>
    </step>
    </job>



    <bean id="paymentRecordWriter" name="paymentRecordWriter" class="com.comdata.vp.batch.io.PaymentRecordItemWr iter">
    <property name="paymentRecordDao" ref="paymentRecordDao"/>

    </bean>

    <bean id="paymentRecordDao" name="paymentRecordDao" class="com.comdata.vp.batch.dao.PaymentRecordDao">
    <property name="dataSource" ref="dataSource" />
    </bean>


    <bean id="paymentRecordReader" name="paymentRecordReader" class="org.springframework.batch.item.file.FlatFil eItemReader">
    <property name="resource" value="file:${DATA_FILE_LOCATION}" />
    <property name="lineMapper">
    <bean id="abc" name="abc" class="org.springframework.batch.item.file.mapping .DefaultLineMapper">
    <property name="lineTokenizer" ref="fixedFileTokenizer"/>

    <property name="fieldSetMapper" ref="fieldSetMapper">

    </property>
    </bean>
    </property>
    </bean>

    <bean id="fixedFileTokenizer" name="fixedFileTokenizer"
    class="org.springframework.batch.item.file.transfo rm.FixedLengthTokenizer">
    <property name="names"
    value="fileKey,
    updateDate,
    instTypeCode,
    officeCode,
    routingMicr
    " />
    <property name="columns"
    value="1-17,
    18-23,
    24-25,
    26-27,
    28-36
    " />
    </bean>


    <bean id="fieldSetMapper" name="fieldSetMapper"
    class="com.comdata.vp.batch.domain.mapper.PaymentR ecordFieldSetMapper">


    </bean>



    <bean id="paymentRecordProperties" name="paymentRecordProperties" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="properties">
    <value>
    paymentRecord.file.name=data/Test1.txt
    job.commit.interval=2
    </value>
    </property>
    <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
    <property name="ignoreUnresolvablePlaceholders" value="true" />
    <property name="order" value="1" />
    </bean>

    <bean id="skipListener" class="com.comdata.vp.batch.exception.PaymentRecor dErrorHandelling"
    />





    </beans>
    Last edited by ankkha; Aug 8th, 2011 at 09:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •