2014-11-06 44 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

相关问题