2016-12-20 6 views
0

システムを実行しようとしているときにそのタグが無効であるSAXParserExceptionが発生しました。スプリングバッチ: 'batch:job'要素で始まる無効なコンテンツが見つかりました

以下

私の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-複雑-type.2.4.c:一致するワイルドカードは厳しいです要素 'batch:job'の宣言は見つかりません。

を以下に行う試みたが、運:

1)は、XSDの異なる点バージョンに変更するクラスパス

2)からXSDを試み参照試しました。しかし、それでも問題は変わりません。

ここで何か問題がありますか?

答えて

3

あなたは宣言の一部を逃した

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

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

を交換してください。

+0

xsdバージョンを2.2に変更しようとしました。まだ運がない。同じ例外です。 – Raghav

+0

このように使用してください:http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd – pringi

関連する問題