Java Spring批处理:发现以元素';开头的内容无效;批处理:作业';

Java Spring批处理:发现以元素';开头的内容无效;批处理:作业';,java,spring,spring-batch,Java,Spring,Spring Batch,我在尝试运行系统时收到一个SAXParserException,即标记无效 下面是我的xml: <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.or

我在尝试运行系统时收到一个SAXParserException,即标记无效

下面是我的xml:

<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:batch="http://www.springframework.org/schema/batch"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/batch 
http://www.springframework.org/schema/batch/spring-batch.xsd"
default-lazy-init="true">

<bean id="myItemProcessor" class="com.MyItemProcessor"/>
<bean id="myItemReader" class="com.MyItemReader"/>
<bean id="myItemWriter" class="com.MyItemWriter"/>

<batch:job id="helloWorldJob">
    <batch:step id="step1">
        <batch:tasklet>
            <batch:chunk reader="myItemReader" writer="myItemWriter"
                processor="myItemProcessor" commit-interval="10">
            </batch:chunk>
        </batch:tasklet>
    </batch:step>
</batch:job>

以下是我一直得到的例外情况:

cvc复杂类型.2.4.c:匹配的通配符是严格的,但找不到元素“batch:job”的声明

尝试执行以下操作,但运气不佳:

1) 尝试从类路径引用xsd

2) 尝试修改到xsd的不同点版本。但问题仍然是一样的

我做错什么了吗

更换

http://www.springframework.org/schema/batch/spring-batch.xsd

您遗漏了声明的一部分。

替换

http://www.springframework.org/schema/batch/spring-batch.xsd


您遗漏了声明的一部分。

尝试将xsd版本修改为2.2。还是不走运。这是同样的例外。然后像这样使用:尝试将xsd版本修改为2.2。还是不走运。这是同样的例外。那么像这样使用: