Announcement Announcement Module
Collapse
No announcement yet.
child of abstract step fails with "no 'skippable-exception-classes' though configured Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 08:50 AM. Reason: edited a letter too much, my bad

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

    Comment


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

      Comment


      • #4
        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, 07:31 AM.

        Comment


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

          Comment

          Working...
          X