Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring集成-SpelEvaluationException:操作符';添加';类型为';java.lang.String';和';空';_Java_Spring_Batch File_Ftp_Integration - Fatal编程技术网

Spring集成-SpelEvaluationException:操作符';添加';类型为';java.lang.String';和';空';

Spring集成-SpelEvaluationException:操作符';添加';类型为';java.lang.String';和';空';,java,spring,batch-file,ftp,integration,Java,Spring,Batch File,Ftp,Integration,我有一个Spring批处理/集成作业,它应该轮询FTP服务器,获取所有的.txt文件,使用Spring批处理组件转换它们,然后将它们放入队列(使用ActiveMQ实现)。但是,我在尝试从FTP区域检索文件时遇到以下错误: ERROR [org.springframework.integration.handler.LoggingHandler] - <org.springframework.expression.spel.SpelEvaluationException: EL1030E:(

我有一个Spring批处理/集成作业,它应该轮询FTP服务器,获取所有的.txt文件,使用Spring批处理组件转换它们,然后将它们放入队列(使用ActiveMQ实现)。但是,我在尝试从FTP区域检索文件时遇到以下错误:

ERROR [org.springframework.integration.handler.LoggingHandler] - <org.springframework.expression.spel.SpelEvaluationException: EL1030E:(pos 0): The operator 'ADD' is not supported between objects of type 'java.lang.String' and 'null'
(部分)FileMessageListener.java:

public class FileMessageListener implements MessageListener {

    private static final Logger logger = Logger.getLogger(FileMessageListener.class);

    public void onMessage(Message message) {
        try {
            logger.info("Received file " + message.getStringProperty("fileName"));
        } catch (JMSException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
我正在测试这个设置

public class FileListener {
    private static final Logger logger = Logger.getLogger(FileListener.class);
    private static final String CONFIG = "/launch-context.xml";

    public static void main(String[] args) throws Exception {
        logger.debug("FileListener started");
        new ClassPathXmlApplicationContext(CONFIG);
    }
}
完整堆栈跟踪:

2015-03-09 10:06:52,879 INFO [org.springframework.context.support.ClassPathXmlApplicationContext] - <Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@644b27ad: startup date [Mon Mar 09 10:06:52 CET 2015]; root of context hierarchy>
2015-03-09 10:06:52,931 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [launch-context.xml]>
2015-03-09 10:06:53,111 INFO [org.springframework.context.annotation.ClassPathBeanDefinitionScanner] - <JSR-330 'javax.inject.Named' annotation found and supported for component scanning>
2015-03-09 10:06:53,187 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [META-INF/spring/datasource-beans.xml]>
2015-03-09 10:06:53,228 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [META-INF/spring/job.xml]>
2015-03-09 10:06:53,303 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Overriding bean definition for bean 'transactionManager': replacing [Generic bean: class [org.springframework.jdbc.datasource.DataSourceTransactionManager]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [META-INF/spring/datasource-beans.xml]] with [Generic bean: class [org.springframework.batch.support.transaction.ResourcelessTransactionManager]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [META-INF/spring/job.xml]]>
2015-03-09 10:06:53,321 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Overriding bean definition for bean 'myJob': replacing [Generic bean: class [org.springframework.batch.core.configuration.xml.SimpleFlowFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.batch.core.configuration.xml.JobParserJobFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]>
2015-03-09 10:06:53,326 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [META-INF/spring/queue.xml]>
2015-03-09 10:06:54,043 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [META-INF/spring/integration.xml]>
2015-03-09 10:06:54,367 INFO [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] - <Loading properties file from URL [file:/.../externalConfig/dev/application.properties]>
2015-03-09 10:06:54,386 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Overriding bean definition for bean 'stepListener': replacing [Generic bean: class [package.StepListener]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [META-INF/spring/job.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [META-INF/spring/job.xml]]>
2015-03-09 10:06:54,386 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Overriding bean definition for bean 'filradReader': replacing [Generic bean: class [org.springframework.batch.item.file.FlatFileItemReader]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [META-INF/spring/job.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [META-INF/spring/job.xml]]>
2015-03-09 10:06:54,387 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Overriding bean definition for bean 'multiResourceWriter': replacing [Generic bean: class [org.springframework.batch.item.file.MultiResourceItemWriter]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [META-INF/spring/job.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [META-INF/spring/job.xml]]>
2015-03-09 10:06:54,387 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Overriding bean definition for bean 'filradXmlWriter': replacing [Generic bean: class [org.springframework.batch.item.xml.StaxEventItemWriter]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [META-INF/spring/job.xml]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [META-INF/spring/job.xml]]>
2015-03-09 10:06:54,391 INFO [org.springframework.integration.config.xml.DefaultConfiguringBeanFactoryPostProcessor] - <No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.>
2015-03-09 10:06:54,392 INFO [org.springframework.integration.config.xml.DefaultConfiguringBeanFactoryPostProcessor] - <No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.>
2015-03-09 10:06:54,402 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] - <JSR-330 'javax.inject.Inject' annotation found and supported for autowiring>
2015-03-09 10:06:54,415 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6112f78c: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.jdbc.datasource.init.DataSourceInitializer#0,dataSource,transactionManager,jobLauncher,org.springframework.batch.core.scope.internalStepScope,org.springframework.beans.factory.config.CustomEditorConfigurer,org.springframework.batch.core.configuration.xml.CoreNamespacePostProcessor,jobRepository,filradSetMapper,stepListener,jobListener,callbackHandler,suffixCreator,filradProcessor,textToXmlStep,addToQueueStep,myJob,multiResourceReader,filradReader,filradCompositeLineMapper,taxiTokenizer,biljettTokenizer,rullstolTokenizer,multiResourceWriter,filradXmlWriter,filradTyperValidMarshaller,addFilesToQueueTasklet,connectionFactory,destination,jmsTemplate,messageProducer,messageListener,org.springframework.jms.listener.DefaultMessageListenerContainer#0,channelInitializer,$autoCreateChannelCandidates,org.springframework.integration.internalDefaultConfiguringBeanFactoryPostProcessor,outboundJobRequestChannel,jobLaunchReplyChannel,inboundFileChannel,org.springframework.batch.integration.launch.JobLaunchingGateway#0,org.springframework.integration.config.ConsumerEndpointFactoryBean#0,org.springframework.integration.handler.LoggingHandler#0,org.springframework.integration.config.ConsumerEndpointFactoryBean#1,org.springframework.integration.config.TransformerFactoryBean#0,org.springframework.integration.config.ConsumerEndpointFactoryBean#2,ftpClientFactory,ftpChannel,org.springframework.scheduling.support.PeriodicTrigger#0,ftpInbound,ftpController,scopedTarget.stepListener,scopedTarget.filradReader,scopedTarget.multiResourceWriter,scopedTarget.filradXmlWriter,nullChannel,errorChannel,_org.springframework.integration.errorLogger,taskScheduler,org.springframework.integration.config.IdGeneratorConfigurer#0]; root of factory hierarchy>
2015-03-09 10:06:54,597 INFO [org.springframework.jdbc.datasource.init.ResourceDatabasePopulator] - <Executing SQL script from URL [jar:file:/C:/Users/jesleh/.m2/repository/org/springframework/batch/spring-batch-core/2.2.3.RELEASE/spring-batch-core-2.2.3.RELEASE.jar!/org/springframework/batch/core/schema-drop-hsqldb.sql]>
2015-03-09 10:06:54,601 INFO [org.springframework.jdbc.datasource.init.ResourceDatabasePopulator] - <Done executing SQL script from URL [jar:file:/C:/Users/jesleh/.m2/repository/org/springframework/batch/spring-batch-core/2.2.3.RELEASE/spring-batch-core-2.2.3.RELEASE.jar!/org/springframework/batch/core/schema-drop-hsqldb.sql] in 4 ms.>
2015-03-09 10:06:54,601 INFO [org.springframework.jdbc.datasource.init.ResourceDatabasePopulator] - <Executing SQL script from URL [jar:file:/C:/Users/jesleh/.m2/repository/org/springframework/batch/spring-batch-core/2.2.3.RELEASE/spring-batch-core-2.2.3.RELEASE.jar!/org/springframework/batch/core/schema-hsqldb.sql]>
2015-03-09 10:06:54,614 INFO [org.springframework.jdbc.datasource.init.ResourceDatabasePopulator] - <Done executing SQL script from URL [jar:file:/C:/Users/jesleh/.m2/repository/org/springframework/batch/spring-batch-core/2.2.3.RELEASE/spring-batch-core-2.2.3.RELEASE.jar!/org/springframework/batch/core/schema-hsqldb.sql] in 12 ms.>
2015-03-09 10:06:54,663 INFO [org.springframework.batch.core.repository.support.JobRepositoryFactoryBean] - <No database type set, using meta data indicating: HSQL>
2015-03-09 10:06:54,797 INFO [org.springframework.batch.core.launch.support.SimpleJobLauncher] - <No TaskExecutor has been set, defaulting to synchronous executor.>
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2015-03-09 10:06:55,027 INFO [org.springframework.oxm.jaxb.Jaxb2Marshaller] - <Creating JAXBContext with classes to be bound [class package.Filrad]>
2015-03-09 10:06:55,490 INFO [org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler] - <Initializing ExecutorService  'taskScheduler'>
2015-03-09 10:06:55,498 INFO [org.springframework.context.support.DefaultLifecycleProcessor] - <Starting beans in phase -2147483648>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.endpoint.EventDrivenConsumer] - <Adding {message-handler} as a subscriber to the 'outboundJobRequestChannel' channel>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.channel.DirectChannel] - <Channel 'outboundJobRequestChannel' has 1 subscriber(s).>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.endpoint.EventDrivenConsumer] - <started org.springframework.integration.config.ConsumerEndpointFactoryBean#0>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.endpoint.EventDrivenConsumer] - <Adding {logging-channel-adapter} as a subscriber to the 'jobLaunchReplyChannel' channel>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.channel.DirectChannel] - <Channel 'jobLaunchReplyChannel' has 1 subscriber(s).>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.endpoint.EventDrivenConsumer] - <started org.springframework.integration.config.ConsumerEndpointFactoryBean#1>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.endpoint.EventDrivenConsumer] - <Adding {transformer} as a subscriber to the 'ftpChannel' channel>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.channel.DirectChannel] - <Channel 'ftpChannel' has 1 subscriber(s).>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.endpoint.EventDrivenConsumer] - <started org.springframework.integration.config.ConsumerEndpointFactoryBean#2>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.endpoint.EventDrivenConsumer] - <Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.channel.PublishSubscribeChannel] - <Channel 'errorChannel' has 1 subscriber(s).>
2015-03-09 10:06:55,498 INFO [org.springframework.integration.endpoint.EventDrivenConsumer] - <started _org.springframework.integration.errorLogger>
2015-03-09 10:06:55,499 INFO [org.springframework.context.support.DefaultLifecycleProcessor] - <Starting beans in phase 2147483647>
2015-03-09 10:06:55,755 INFO [org.springframework.integration.endpoint.SourcePollingChannelAdapter] - <started ftpInbound>
2015-03-09 10:07:10,041 ERROR [org.springframework.integration.handler.LoggingHandler] - <org.springframework.expression.spel.SpelEvaluationException: EL1030E:(pos 0): The operator 'ADD' is not supported between objects of type 'java.lang.String' and 'null'
    at org.springframework.expression.spel.ExpressionState.operate(ExpressionState.java:191)
    at org.springframework.expression.spel.ast.OpPlus.getValueInternal(OpPlus.java:59)
    at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
    at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:102)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.generateLocalFileName(AbstractInboundFileSynchronizer.java:228)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.copyFileToLocalDirectory(AbstractInboundFileSynchronizer.java:174)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:150)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.receive(AbstractInboundFileSynchronizingMessageSource.java:146)
    at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:111)
    at org.springframework.integration.endpoint.AbstractTransactionSynchronizingPollingEndpoint.doPoll(AbstractTransactionSynchronizingPollingEndpoint.java:67)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:236)
    at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
    at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:231)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
2015-03-09 10:06:52879信息[org.springframework.context.support.ClassPathXmlApplicationContext]-
2015-03-09 10:06:52931信息[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-
2015-03-09 10:06:53111信息[org.springframework.context.annotation.ClassPathBeanDefinitionScanner]-
2015-03-09 10:06:53187信息[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-
2015-03-09 10:06:53228信息[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-
2015-03-09 10:06:53303信息[org.springframework.beans.factory.support.DefaultListableBeanFactory]-
2015-03-09 10:06:53321信息[org.springframework.beans.factory.support.DefaultListableBeanFactory]-
2015-03-09 10:06:53326信息[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-
2015-03-09 10:06:54043信息[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-
2015-03-09 10:06:54367信息[org.springframework.beans.factory.config.propertyplaceholderconfigure]-
2015-03-09 10:06:54386信息[org.springframework.beans.factory.support.DefaultListableBeanFactory]-
2015-03-09 10:06:54386信息[org.springframework.beans.factory.support.DefaultListableBeanFactory]-
2015-03-09 10:06:54387信息[org.springframework.beans.factory.support.DefaultListableBeanFactory]-
2015-03-09 10:06:54387信息[org.springframework.beans.factory.support.DefaultListableBeanFactory]-
2015-03-09 10:06:54391信息[org.springframework.integration.config.xml.DefaultConfiguringBeanFactoryPostProcessor]-
2015-03-09 10:06:54392信息[org.springframework.integration.config.xml.DefaultConfiguringBeanFactoryPostProcessor]-
2015-03-09 10:06:54402信息[org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor]-
2015-03-09 10:06:54415信息[org.springframework.beans.factory.support.DefaultListableBeanFactory]-
2015-03-09 10:06:54597信息[org.springframework.jdbc.datasource.init.ResourceDatabasePopulator]-
2015-03-09 10:06:54601信息[org.springframework.jdbc.datasource.init.ResourceDatabasePopulator]-
2015-03-09 10:06:54601信息[org.springframework.jdbc.datasource.init.ResourceDatabasePopulator]-
2015-03-09 10:06:54614信息[org.springframework.jdbc.datasource.init.ResourceDatabasePopulator]-
2015-03-09 10:06:54663信息[org.springframework.batch.core.repository.support.JobRepositoryFactoryBean]-
2015-03-09 10:06:54797信息[org.springframework.batch.core.launch.support.simplejoblancher]-
SLF4J:未能加载类“org.SLF4J.impl.StaticLoggerBinder”。
SLF4J:默认为无操作(NOP)记录器实现
SLF4J:参见http://www.slf4j.org/codes.html#StaticLoggerBinder 详情请参阅。
2015-03-09 10:06:55027信息[org.springframework.oxm.jaxb.Jaxb2Marshaller]-
2015-03-09 10:06:55490信息[org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler]-
2015-03-09 10:06:55498信息[org.springframework.context.support.DefaultLifecycleProcessor]-
2015-03-09 10:06:55498信息[org.springframework.integration.endpoint.EventDrivenConsumer]-
2015-03-09 10:06:55498信息[org.springframework.integration.channel.DirectChannel]-
2015-03-09 10:06:55498信息[org.springframework.integration.endpoint.EventDrivenConsumer]-
2015-03-09 10:06:55498信息[org.springframework.integration.endpoint.EventDrivenConsumer]-
2015-03-09 10:06:55498信息[org.springframework.integration.channel.DirectChannel]-
2015-03-09 10:06:55498信息[org.springframework.integration.endpoint.EventDrivenConsumer]-
2015-03-09 10:06:55498信息[org.springframework.integration.endpoint.EventDrivenConsumer]-
2015-03-09 10:06:55498信息[org.springframework.integration.channel.DirectChannel]-
2015-03-09 10:06:55498信息[org.springframework.integration.endpoint.EventDrivenConsumer]-
2015-03-09 10:06:55498信息[org.springframework.integration.endpoint.EventDrivenConsumer]-
2015-03-09 10:06:55498信息[org.springframework.integration.channel.PublishSubscribeChannel]-
2015-03-09 10:06:55498信息[org.springframework.integration.endpoint.EventDrivenConsumer]-
2015-03-09 10:06:55499信息[org.springframework.context.support.DefaultLifecycleProcessor]-
2015-03-09 10:06:55755信息[org.springframework.integration.endpoint.SourcePollingChannelAdapter]-

2015-03-09 10:07:10041错误[org.springframework.integration.handler.LoggingHandler]-我把它作为一个答案

第一个错误是因为在执行操作时传递了null
本地文件名生成器表达式=“+#this
”。尝试提供值似乎可以解决此问题
本地文件名生成器表达式=“'sample'+#this”

注释中的第二个错误是由于方法签名。下面的方法将
消息
作为arg,而它的调用者将io.File作为arg传递。因此出现了错误。根据提供的信息,我不确定打电话的人在哪里,但这应该能告诉你错误的要点

public JobLaunchRequest toRequest(Message<File> message) {
        JobParametersBuilder jobParametersBuilder =
            new JobParametersBuilder();
public job启动请求到请求(消息){
作业参数生成器作业参数生成器=
新作业参数builder();

我通过使用

  <int:service-activator id="runJob" method="launch" input-channel="outboundJobRequestChannel"
        output-channel="statuses">
        <bean class="org.springframework.batch.integration.launch.JobLaunchingMessageHandler">
            <constructor-arg ref="jobLauncher"/>
        </bean>
    </int:service-activator>

而不是

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


然后将toRequest方法的参数更改为(java.io.File文件)。现在一切正常。感谢@minion的帮助。

我想问题可能在这里。本地文件
public JobLaunchRequest toRequest(Message<File> message) {
        JobParametersBuilder jobParametersBuilder =
            new JobParametersBuilder();
  <int:service-activator id="runJob" method="launch" input-channel="outboundJobRequestChannel"
        output-channel="statuses">
        <bean class="org.springframework.batch.integration.launch.JobLaunchingMessageHandler">
            <constructor-arg ref="jobLauncher"/>
        </bean>
    </int:service-activator>
<batch-int:job-launching-gateway request-channel="outboundJobRequestChannel"
                                   reply-channel="jobLaunchReplyChannel"
                                   job-launcher="jobLauncher" />