Announcement Announcement Module
Collapse
No announcement yet.
Upgrade from spring-batch 2 to 2.1 --> Schema problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgrade from spring-batch 2 to 2.1 --> Schema problem

    Hi,

    After upgrading from spring-batch 2 to 2.1 I get he following error when i try to validate my context file againts the new schema:

    My Job:

    HTML Code:
    <batch:job id="importUsageJob" parent="simpleJob">
            <batch:listeners>
                <batch:listener ref="importUsageJobListener"/>
            </batch:listeners>
            <batch:step id="registrationStep">
                <batch:fail on="STOPPED"/>  
                <batch:fail on="FAILED" exit-code="EARLY TERMINATION"/>
                <batch:next on="*" to="readWriteStep" />
                [B]<batch:tasklet ref="processRegistration"/>[/B]
            </batch:step>
            <batch:step id="readWriteStep">  
                <batch:tasklet>
                    <batch:chunk reader="eventFileItemReader${importUsageAdServingEngine}" writer="itemWriter" commit-interval="${importUsageCommitInterval}" skip-limit="2147483647">
                       [B] <batch:skippable-exception-classes>
                            com.liav.adam.ImportUsage.util.ImportUsageRuntimeException,
                            org.springframework.batch.item.file.FlatFileParseException	
                        </batch:skippable-exception-classes>
                    </batch:chunk>
                    <batch:no-rollback-exception-classes>
                        java.lang.Throwable
                    </batch:no-rollback-exception-classes>[/B]
                    <batch:listeners>
                        <batch:listener ref="stepListener"/>
                    </batch:listeners>	
                </batch:tasklet>
            </batch:step>
        </batch:job>
    The errors:

    1. Invalid content was found starting with element 'batch:tasklet'. One of '{"http://www.springframework.org/schema/batch":next, "http://www.springframework.org/schema/batch":stop, "http://www.springframework.org/schema/batch":end, "http://www.springframework.org/schema/batch":fail}' is expected.

    2. Element 'batch:skippable-exception-classes' cannot have character [children], because the type's content type is element-only.

    3. Element 'batch:no-rollback-exception-classes' cannot have character [children], because the type's content type is element-only.

    For the first error i looked up in Spring-Batch tutorial & saw that 'tasklet' is indeed nested inside the 'step'.

    Can someone paste an example of such job under spring-batch-2.1.xsd ?

    Thanks.

  • #2
    The tasklet is nested inside a chunk in 2.1. There are plenty of examples in the samples (https://src.springframework.org/svn/...resources/jobs) and unit tests (many at https://src.springframework.org/svn/...figuration/xml others in the same project).

    Which tutorial were you looking at? Is it for Batch 2.1?

    Comment


    • #3
      Hi Dave...I am very new for Spring Framework , but some how i got a project where Spring is being used , I have the same problem. When i tried to use <skippable-exception-classes> tag , i was not working with batch xsd 2.0 not only that when i changed 2.0 to 2.1 its showing me that beanName is missing...if you will ask i will provide you the problem in more detail.Thanks

      Comment

      Working...
      X