Results 1 to 9 of 9

Thread: Unable to define job tag in spring batch job.xml

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    12

    Default Unable to define job tag in spring batch job.xml

    Hi ,

    I am trying to use conditional flow in specific job xml .Please find the declaration and the error encountered by me

    Code:
    <job id="sampleMyJob">
    		<step name="step1" next="step2"/>
    		<step name="step2"/>
    </job>
    And the following is the exception i am receiving .

    Code:
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'job'. One of '{"http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"]}' is expected.
    Please help me out .Thanks in advance
    CVUK

  2. #2
    Join Date
    Feb 2008
    Posts
    488

    Default

    First, you're using spring batch 2.0 right?

    Second, do you have the schema specified in the xml file?:

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

  3. #3
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    I just realized we don't mention that in the docs, we'll be sure to add it:

    http://jira.springframework.org/browse/BATCH-1062

  4. #4
    Join Date
    Dec 2008
    Posts
    18

    Default

    I don't see the xsd document at the url mentioned: http://www.springframework.org/schem...-batch-2.0.xsd. Not sure if this is intentional.

  5. #5
    Join Date
    Feb 2008
    Posts
    488

    Default

    Quote Originally Posted by stevelaw18 View Post
    I don't see the xsd document at the url mentioned: http://www.springframework.org/schem...-batch-2.0.xsd. Not sure if this is intentional.
    The xsd hasn't been uploaded to that location yet. It will be once 2.0 is released.

  6. #6
    Join Date
    Jan 2009
    Posts
    12

    Default

    Hi,

    After specifying the above mentioned schema definition in the xml file , i get the following exception


    Code:
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'job'.

    What could be the issue ?


    Regards,
    cvuk

Posting Permissions

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