使用spring批处理时,batch-int出错:job-launching-gateway

时间:2016-08-02 09:34:55

标签: spring spring-batch

我正在尝试使用batch-int:job-launching-gateway,但是我收到以下错误:

Exception in thread "main"     org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:spring/integration-context.xml]
Offending resource: class path resource [spring/application-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 68 in XML document from class path resource [spring/integration-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
lineNumber: 68; columnNumber: 156; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'batch-int:job-launching-gateway'.

我的xml包含以下内容:

<beans:beans xsi:schemaLocation=" http://www.springframework.org/schema/batch-integration
 http://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd
 http://www.springframework.org/schema/batch
 http://www.springframework.org/schema/batch/spring-batch.xsd
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/integration
 http://www.springframework.org/schema/integration/spring-integration.xsd
 http://www.springframework.org/schema/integration/file
 http://www.springframework.org/schema/integration/file/spring-integration-file.xsd "
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:int-file="http://www.springframework.org/schema/integration/file"
         xmlns:int="http://www.springframework.org/schema/integration"
         xmlns:beans="http://www.springframework.org/schema/beans"
         xmlns:batch-int="http://www.springframework.org/schema/batch-integration"
         xmlns:batch="http://www.springframework.org/schema/batch"
         xmlns="http://www.springframework.org/schema/beans">

错误发生的行是:

<batch-int:job-launching-gateway job-launcher="jobLauncher" reply-channel="jobLaunchReplyChannel" request-channel="channelStart"/>

频道&#34;频道启动&#34;在此之上定义。

我是春季批次的新手,所以任何帮助都会很棒。我还在类路径上有spring-batch-integration,spring-batch-core,spring-batch-infrastructure和spring-integration-event。

1 个答案:

答案 0 :(得分:0)

我已经解决了这个问题。我最初对spring-batch-core和spring-batch-integration都有不同的版本。当我将这两个版本设为相同版本时,错误没有出现。