Results 1 to 5 of 5

Thread: child of abstract step fails with "no 'skippable-exception-classes' though configured

  1. #1
    Join Date
    Nov 2010
    Posts
    20

    Default child of abstract step fails with "no 'skippable-exception-classes' though configured

    Good evening,

    I have tried today to minimize the amount of configuration for my export batch jobs and was unable to resolve the following problem.
    I used the reference documentation to find my way around and I see nothing wrong with my coding...

    All with Spring 3 and latest Batch version
    HTML Code:
    <!-- ========================================================================================== -->
        <!-- Definition of the base job -->
        <!-- ========================================================================================== -->
        <batch:job id="baseJob" restartable="true" abstract="true">
            <batch:validator ref="jobParamsValidator" />
        </batch:job>
    
        <!-- ========================================================================================== -->
        <!-- Definition of the base step -->
        <!-- ========================================================================================== -->
        <batch:step id="export" abstract="true">
            <batch:tasklet>
                <batch:chunk reader="itemReader" processor="itemProcessor" writer="itemWriter" 
                commit-interval="50" skip-limit="99999">
                    <batch:skippable-exception-classes>
                        <batch:include class="java.lang.Exception" />
                        <batch:exclude class="java.io.FileNotFoundException" />
                        <batch:exclude class="javax.xml.bind.JAXBException" />
                        <batch:exclude class="org.xml.sax.SAXException" />
                        <batch:exclude class="org.springframework.batch.item.file.FlatFileParseException" />
                        <batch:exclude class="javax.xml.bind.MarshalException" />
                        <batch:exclude class="org.springframework.oxm.MarshallingFailureException" />
                    </batch:skippable-exception-classes>
                </batch:chunk>
                <batch:listeners>
                    <batch:listener ref="documentSkipListener" />
                </batch:listeners>
            </batch:tasklet>
        </batch:step>
    
        <bean id="documentSkipListener" class="xx.xx.DocumentSkipListener" />
    And this is my concrete job/step combination:

    HTML Code:
        <!-- ========================================================================================== -->
        <!-- Definition of the stmt file to XML job -->
        <!-- ========================================================================================== -->
        <batch:job id="exportXmlJob" parent="baseJob">
            <batch:step id="exportXML" parent="export">
                <batch:tasklet>
                    <batch:chunk >
                        <batch:streams>
                            <batch:stream ref="somethingFileItemReader" />
                        </batch:streams>
                    </batch:chunk>
                    <batch:listeners merge="true">
                        <batch:listener ref="somethingCompositeItemWriter"/>
                    </batch:listeners>
                </batch:tasklet>
            </batch:step>
        </batch:job>
    This should work if the reference is true , but I get a


    HTML Code:
    Caused by: java.lang.IllegalArgumentException: The field 'skip-limit' is not permitted on the step [exportXML] because there is no 'skippable-exception-classes'.
    	at org.springframework.batch.core.configuration.xml.StepParserStepFactoryBean.validateDependency(StepParserStepFactoryBean.java:548)
    	at org.springframework.batch.core.configuration.xml.StepParserStepFactoryBean.validateFaultTolerantSettings(StepParserStepFactoryBean.java:518)
    	at org.springframework.batch.core.configuration.xml.StepParserStepFactoryBean.getObject(StepParserStepFactoryBean.java:217)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
    Strange thing is both (skippable-exception-classes and skip-limit) are configured in the parent step...... what am I missing here?

    Thanks for any advice.

    Yours sincerly,
    Y.
    Last edited by Yvory; Oct 5th, 2011 at 07:50 AM. Reason: edited a letter too much, my bad

  2. #2
    Join Date
    Jan 2011
    Posts
    12

    Default

    Hello,

    Was there ever an answer posted for this problem. I am experiencing the exact same issue today. Will continue to search forum, but thought I would ask since I found this thread.

  3. #3
    Join Date
    Nov 2009
    Posts
    7

    Default

    Make sure to specify merge on your child chunk tasklet (even when there is nothing extra to merge)

    <batch:skippable-exception-classes merge="true" />

    Seems to be required configuration since recent versions of Spring Batch.

  4. #4
    Join Date
    Jan 2011
    Posts
    12

    Default

    Thank youfor your prompt answer.

    Your suggestion is exactly what i figured out through trial and error.

    Thanks again

    However for Dave and company:
    I ran into a situation where the retry mechanism was thrown into an internal loop which I traced to the retry template. The situation occured when the hashCode function threw an exception. In my case, I had overlooked the Null values that were being returned to create a business object. So when implementing retry, I had a null pointer exception thrown. That caused the infinite looping inside the repeat template function. Took a lokk in debugger and finally figured it out, augmented our business rules and everything works fine now.

    kmr
    Last edited by kmr; Nov 15th, 2011 at 06:31 AM.

  5. #5
    Join Date
    Nov 2010
    Posts
    20

    Default

    Hi there ,

    THANK YOU for this information, I was just trying again to get this to run and with this little line it does.


    As a plea to the developers:

    PLEASE, add this little secret to the reference documentation, that this is needed, I'd never guessed this myself without debugging and stuff....

Posting Permissions

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