【发布时间】:2015-10-12 12:42:24
【问题描述】:
我尝试在文件入站通道适配器和 FileSplitter 之间预处理文件。为此,我编写了一个执行该工作的类:\
@MessageEndpoint
public class ReleaseManagerForFlatFile {
@ServiceActivator
public Message<?> processFileCounter(Message<?> message) {
Get the job Done !
return message;
}
}
我将它包含在我的 spring 集成配置文件中:
<int-file:inbound-channel-adapter
directory="D:\Donnees\Dev\workspace-luna\FileAggreg\In" id="fileIn"
auto-startup="true" channel="channelFile" prevent-duplicates="true">
<int:poller fixed-rate="60000" />
</int-file:inbound-channel-adapter>
<int:channel id="channelFile" />
<int:service-activator id="releaseManager" input-channel="channelFile" output-channel="channelFileIn"
ref="releaseManagerForFlatFile" />
<int:channel id="channelFileIn" />
<int-file:splitter id="splitter" input-channel="channelFileIn" output-channel="channelSplitter" />
但是,当我启动链时,我得到了这个异常:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'releaseManagerControl': Cannot resolve reference to bean 'org.springframework.integration.config.ServiceActivatorFactoryBean#1' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.ServiceActivatorFactoryBean#1': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Target object of type [class org.springframework.integration.endpoint.EventDrivenConsumer] has no eligible methods for handling Messages.
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.ServiceActivatorFactoryBean#1': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Target object of type [class org.springframework.integration.endpoint.EventDrivenConsumer] has no eligible methods for handling Messages.
Caused by: java.lang.IllegalArgumentException: Target object of type [class org.springframework.integration.endpoint.EventDrivenConsumer] has no eligible methods for handling Messages.
我之前写了很多服务激活器,但我从来没有遇到过这个问题...... 上下文:Spring Integration 4.2
【问题讨论】: