突然要用到Spring Batch,就在网上找了一个小例子熟悉下。但在部署环境时老是会报错。
例子:http://www.cnblogs.com/gulvzhe/archive/2011/10/31/2230655.htmlspring 3.0 + Eclipse + spring-batch 2.1.8报错信息如下:
Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 22 in XML document from class path resource [batch.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'job'.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'.在网上google了很久
例如将:将xsd 本地化,还是没什么用。都没找到解决办法。

解决方案 »

  1.   

    根据提示好像是说在:batch.xml的22行出错了。
    主要问题好像是出现没有"job"这个标签元素。
      

  2.   

    TO zjwzjw20062007
    首先感谢你的解答
    在 batch.xml 中第22行已经有"job"这个标签元素。22    <job id="helloWorldJob">
    23        <step id="step_hello" next="step_world">
    24            <tasklet ref="hello" transaction-manager="transactionManager"></tasklet>
    25        </step>
    26        <step id="step_world">
    27            <tasklet ref="world" transaction-manager="transactionManager"></tasklet>
    28        </step>
    29    </job>但还是报出这个错?⊙﹏⊙b 汗
      

  3.   


    TO zjwzjw20062007
    首先感谢你的解答
    在 batch.xml 中第22行已经有"job"这个标签元素。22 <job id="helloWorldJob">
    23 <step id="step_hello" next="step_world">
    24 <tasklet ref="hello" transaction-manager="transactionManager"></tasklet>
    25 </step>
    26 <step id="step_world">
    27 <tasklet ref="world" transaction-manager="transactionManager"></tasklet>
    28 </step>
    29 </job>但还是报出这个错?⊙﹏⊙b 汗
      

  4.   


    TO zjwzjw20062007
    首先感谢你的解答
    在 batch.xml 中第22行已经有"job"这个标签元素。22 <job id="helloWorldJob">
    23 <step id="step_hello" next="step_world">
    24 <tasklet ref="hello" transaction-manager="transactionManager"></tasklet>
    25 </step>
    26 <step id="step_world">
    27 <tasklet ref="world" transaction-manager="transactionManager"></tasklet>
    28 </step>
    29 </job>但还是报出这个错?⊙﹏⊙b 汗