Announcement Announcement Module
Collapse
No announcement yet.
Element 'skippable-exception-classes' must have no element Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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>

      Comment


      • #4
        My stupid...

        I was referring to beans & batch 2.0 schema locations.

        Comment


        • #5
          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...

          Comment


          • #6
            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">

            Comment


            • #7
              What do you mean by this tag

              transaction-manager="ora-transactionManager"

              Comment


              • #8
                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.

                Comment


                • #9
                  Please port your xml files.

                  Regards
                  AN

                  Comment


                  • #10
                    <?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, 09:47 AM.

                    Comment


                    • #11
                      Hi,

                      At several places in your xml there are unrequired spaces.

                      Kindly use the CODE wrapper around your xml for better readability!!

                      Comment


                      • #12
                        Updated XML

                        <?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"/>

                        <step id="paymentRecordLoadJob" xmlns="http://www.springframework.org/schema/batch">
                        <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>

                        <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,
                        routingFrac,
                        fullInstituteName,
                        instituteNumberAbbr,
                        streetAddress,
                        city,
                        stateAbbr,
                        zip,
                        fullZip,
                        mailAddress,
                        mailCity,
                        mailState,
                        mailZipCode,
                        mailFullZip,
                        branchOfficeNameAbbr,
                        headOffRoutingNumber,
                        phoneAreaCode,
                        phoneNumber,
                        phoneNumberExt,
                        faxAreaCode,
                        faxNumber,
                        faxExtension,
                        headoffAsstSize,
                        fedRsrvDistCode,
                        lastUpdatedForTwoKYearOne,
                        headOffFileKey,
                        routingNumType,
                        routingNumStatus,
                        employerTaxId,
                        achFlag,
                        fedRsrvRoutingNum,
                        instiIdentiOne,
                        lastUpdatedDate,
                        wireTrnsfrContactName,
                        wireTrnsfrAreaCode,
                        wireTrnsfrPhoneNumber,
                        wireTrnsfrExtension,
                        eftContactName,
                        eftAreaCode,
                        eftPhoneNumber,
                        eftExtension,
                        ediContactNameOne,
                        ediAreaCodeOne,
                        ediPhoneNumberOne,
                        ediExtensionOne,
                        fedwireFundStatus,
                        fedwireSecuritiesStatus,
                        fedwireTelegraphName,
                        swiftAddress,
                        bicAddress,
                        wireTrxCode,
                        fedWireCorrespAbbr,
                        fedwireCorresFundStatus,
                        fedwireCorrespMICR,
                        fedwireCorrespAsst,
                        lastUpdatedForTwoKYearTwo,
                        instiIdentiTwo,
                        fedWireCorrespFileKeyTwo,
                        mainOfficeFilekey,
                        lastUpdatedDateTwo,
                        achContactName,
                        achContAreaCode,
                        achContPhoneNumber,
                        achContExtension,
                        ediContactNameTwo,
                        ediAreaCodeTwo,
                        ediPhoneNumberTwo,
                        ediExtnTwo,
                        paperRetrItemContName,
                        paperRetrItemAreaCode,
                        paperRetrItemPhoneNumber,
                        paperRetrItemExtn,
                        achRetrContName,
                        achRetrAreaCode,
                        achRetrPhnNumber,
                        achRetrExtn,
                        paperAdjContactName,
                        paperAdjAreaCode,
                        paperAdjPhoneNumber,
                        paperAdjExtn,
                        achAdjContactName,
                        achAdjAreaCode,
                        achAdjPhoneNumber,
                        achAdjExtn,
                        orgStatus,
                        receiverStatus,
                        achMICRRoutingNumber,
                        achProvider,
                        achMICRStatus,
                        cuPprPayThr,
                        cuPprPayThrMicr,
                        cuAcctNumberID,
                        cuIdPostion,
                        achPayThr,
                        savAccCrdDebBoth,
                        chkAccCrdDebBoth,
                        localAch,
                        achMemberIndicator,
                        fedResrvAchMicr,
                        fedFundTrnfrStatus,
                        ediCashDisburCode,
                        ediCorpTradePayCode,
                        ediCorpTradeExcng,
                        ediCustInitiEntryCode,
                        priSecAchAssociation,
                        priSecAchMicr,
                        lastUpdatedForTwoKYearThree,
                        instiIdentiThree,
                        lastFiller" />
                        <property name="columns"
                        value="1-17,
                        18-23,
                        24-25,
                        26-27,
                        28-36,
                        37-47,
                        48-205,
                        206-255,
                        256-295,
                        296-325,
                        326-327,
                        328-332,
                        333-336,
                        337-376,
                        377-406,
                        407-408,
                        409-413,
                        414-417,
                        418-447,
                        448-456,
                        457-459,
                        460-466,
                        467-471,
                        472-474,
                        475-481,
                        482-486,
                        487-499,
                        500-505,
                        506-513,
                        514-530,
                        531-558,
                        570-570,
                        571-580,
                        581-581,
                        582-590,
                        591-598,
                        651-656,
                        657-706,
                        707-709,
                        710-716,
                        717-721,
                        722-771,
                        772-774,
                        775-781,
                        782-786,
                        787-836,
                        837-839,
                        840-846,
                        847-851,
                        852-852,
                        853-853,
                        854-871,
                        872-896,
                        897-921,
                        928-928,
                        929-978,
                        979-979,
                        980-988,
                        989-1001,
                        1002-1009,
                        1010-1017,
                        1018-1034,
                        1035-1051,
                        1069-1074,
                        1075-1124,
                        1125-1127,
                        1128-1134,
                        1135-1139,
                        1140-1189,
                        1190-1192,
                        1193-1199,
                        1200-1204,
                        1205-1254,
                        1255-1257,
                        1258-1264,
                        1265-1269,
                        1270-1319,
                        1320-1322,
                        1323-1329,
                        1330-1334,
                        1335-1384,
                        1385-1387,
                        1388-1394,
                        1395-1399,
                        1400-1449,
                        1450-1452,
                        1453-1459,
                        1460-1464,
                        1465-1465,
                        1466-1466,
                        1467-1475,
                        1476-1525,
                        1526-1526,
                        1527-1576,
                        1577-1585,
                        1586-1595,
                        1596-1597,
                        1598-1598,
                        1599-1599,
                        1600-1600,
                        1601-1679,
                        1680-1680,
                        1681-1689,
                        1690-1690,
                        1691-1691,
                        1692-1692,
                        1693-1693,
                        1694-1694,
                        1695-1773,
                        1774-1782,
                        1783-1790,
                        1791-1798,
                        1799-1850" />
                        </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>

                        </beans>

                        Comment


                        • #13
                          I would be greatful for you if you try to reply this post asap because i need it urgently.
                          Thanks

                          Comment


                          • #14
                            Finally i found the problem , i was using spring batch 2.1 xsd with 2.0 jars so i just downloaded the correct version(2.1) jar and after that skippable-exception-classes tag start working

                            Comment

                            Working...
                            X