2014-11-06 30 views
0

我使用Java Spring Integration的2.0.0版本和Java Spring框架3.0.5Java的春天:屬性「時間單位」是不允許元素出現「詮釋:輪詢」

我收到錯誤「屬性'時間單位'不允許出現在元素'int:poller'中。」在我的配置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:context="http://www.springframework.org/schema/context" 
xmlns:int="http://www.springframework.org/schema/integration" 
xmlns:int-file="http://www.springframework.org/schema/integration/file" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd 
    http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd 
    http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd"> 


<int-file:inbound-channel-adapter directory="file:${dir.cu}" 
channel="cuProvinceFilesIn" prevent-duplicates="true" filename-regex=".+\.csv"> 
    <int:poller fixed-delay="60" time-unit="SECONDS" max-messages-per-poll="10" receive-timeout="10000"> 
    </int:poller> 
</int-file:inbound-channel-adapter> 
+0

檢查您的類路徑不同版本的重複春天INT罐子。 – zmf 2014-11-06 16:41:10

回答

1

首先爲什麼不使用更新鮮的框架版本? http://projects.spring.io/spring-integration/

來自對岸我想這只是你的Eclipse IDE中的一個問題,因爲我們知道time-unit是那裏的<poller>element

嘗試爲Eclipse應用Spring nature,幾乎所有東西都應該消失。

來自對岸,你總是可以導致任何time-unitmilliseconds(默認):

<int:poller fixed-delay="60000"> 
+0

我正在加強一個幾年前已經創建的項目,所以改變技術並不符合我的最佳利益。 – 2014-11-06 16:40:17

+0

至少,您應該升級到最新的2.0.x版本(2.0.6)以獲得錯誤修復,但它會__將最符合您的興趣移至更近的地方。 – 2014-11-06 20:04:00

相關問題