2016-08-02 81 views
0

當我嘗試使用批處理INT:作業啓動網關,但我得到了以下錯誤:錯誤與批處理INT:作業啓動網關使用Spring Batch的

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"/> 

信道 「channelStart」 如上定義此。

我是新來的春季批,所以任何幫助將是偉大的。我還在類路徑中使用了spring-batch-integration,spring-batch-core,spring-batch-infrastructure和spring-integration-event。

+0

可能重複:http://stackoverflow.com/questions/13589470/the-matching-wildcard-is-strict-but-no-declaration-can-be-found-for-element-co 你有沒有翻番檢查xml命名空間的支持? http://docs.spring.io/spring-batch/reference/html/springBatchIntegration.html –

+0

嗨,是的,我檢查了XML名稱空間。當我將鼠標懸停在xml中的「batch-in:job-launching-gateway」上時,它給了我一個消息:「這個自定義Spring bean尚未被解析」。如果我試圖解析它,它會給出消息:「無法找到名稱空間的自定義處理程序'http://www.springframework.org/schema/batch-integration'」 – sadWal

回答

0

我已經解決了這個問題。我最初爲彈簧批量核心和彈簧批量整合提供了不同的版本。當我使這兩個版本相同時,錯誤沒有出現。

相關問題