- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Spring 批处理/集成作业,它应该轮询 FTP 服务器,获取所有 .txt 文件,使用 Spring Batch 组件转换它们,然后将它们放入队列(使用 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'
相关的 spring xml 配置(为清楚起见省略了很多代码):
<beans>
<!-- Spring integration setup -->
<int:channel id="outboundJobRequestChannel"/>
<int:channel id="jobLaunchReplyChannel"/>
<int:channel id="inboundFileChannel"/>
<batch-int:job-launching-gateway request-channel="outboundJobRequestChannel"
reply-channel="jobLaunchReplyChannel"
job-launcher="jobLauncher" />
<int:logging-channel-adapter channel="jobLaunchReplyChannel"/>
<int:transformer input-channel="ftpChannel"
output-channel="outboundJobRequestChannel"
method="toRequest">
<bean class="package.FileMessageToJobRequest">
<constructor-arg index="0" ref="myJob" />
<constructor-arg index="1" value="input.file.name" />
</bean>
</int:transformer>
<bean id="ftpClientFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
<property name="host" value="${import.ftp.host}" />
<property name="port" value="${import.ftp.port}" />
<property name="username" value="${import.ftp.username}" />
<property name="password" value="${import.ftp.password}" />
</bean>
<int:channel id="ftpChannel" />
<int-ftp:inbound-channel-adapter id="ftpInbound"
channel="ftpChannel"
session-factory="ftpClientFactory"
auto-create-local-directory="true"
delete-remote-files="false"
filename-pattern="*.txt"
remote-directory="${import.ftp.remotefolder}"
local-filename-generator-expression="+#this"
temporary-file-suffix=".reading"
local-directory="${ftp.localdir}">
<int:poller fixed-rate="1000"/>
</int-ftp:inbound-channel-adapter>
<!-- Spring batch job setup -->
<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
</bean>
<batch:job-repository id="jobRepository" transaction-manager="transactionManager"/>
<bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
<batch:job id="myJob">
<batch:step id="textToXmlStep" next="addToQueueStep">
<batch:tasklet>
<batch:chunk reader="filradReader" writer="multiResourceWriter" commit-interval="${job.commit.interval}" />
</batch:tasklet>
<batch:listeners>
<batch:listener ref="stepListener"/>
</batch:listeners>
</batch:step>
<batch:step id="addToQueueStep">
<batch:tasklet ref="addFilesToQueueTasklet" />
<batch:listeners>
<batch:listener ref="stepListener"/>
</batch:listeners>
</batch:step>
<batch:listeners>
<batch:listener ref="jobListener"/>
</batch:listeners>
</batch:job>
<bean id="filradReader" scope="step" class="org.springframework.batch.item.file.FlatFileItemReader">
<property name="resource" value="file://#{jobParameters['input.file.name']}" />
<property name="lineMapper" ref="filradCompositeLineMapper"/>
<property name="linesToSkip" value="1"/>
<property name="skippedLinesCallback" ref="callbackHandler"/>
<property name="encoding" value="UTF-8" />
</bean>
<bean id="addFilesToQueueTasklet" class="package.FilesToMqTasklet">
<property name="filesBaseDir" value="${files.outputdir}\xml" />
<property name="messageProducer" ref="messageProducer"/>
</bean>
<!-- ActiveMQ setup -->
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
p:brokerURL="${broker.url}" />
<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queue" />
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"
p:connectionFactory-ref="connectionFactory"
p:defaultDestination-ref="destination" />
<bean id="messageProducer" class="package.FileMessageProducer"
p:jmsTemplate-ref="jmsTemplate" />
<bean id="messageListener" class="package.FileMessageListener" />
<jms:listener-container concurrency="5-50">
<jms:listener destination="queue" ref="messageListener"/>
</jms:listener-container>
</beans>
(部分)FileMessageToJobRequest.java:
public FileMessageToJobRequest(final Job job, final String fileParameterName){
this.job = job;
this.fileParameterName = fileParameterName;
}
public JobLaunchRequest toRequest(Message<File> message) {
JobParametersBuilder jobParametersBuilder =
new JobParametersBuilder();
jobParametersBuilder.addString(fileParameterName,
message.getPayload().getAbsolutePath()).addDate("run.date", new Date());
return new JobLaunchRequest(job, jobParametersBuilder.toJobParameters());
}
(部分)FileMessageProducer.java:
public class FileMessageProducer {
private static final Logger logger = Logger.getLogger(FileMessageProducer.class);
protected JmsTemplate jmsTemplate;
public void sendFile(final File file) throws JMSException {
jmsTemplate.send(new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
ObjectMessage message = session.createObjectMessage(file);
message.setStringProperty("fileName", file.getName());
logger.info("Sent message: "+message.getStringProperty("fileName"));
return message;
}
});
}
(部分)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)
作业本身(读取 .txt 文件并将其转换为 xml 输出)有效,我已经单独运行了该步骤,没有出现问题。问题似乎在于从 FTP 区域读取文件。我也试过用谷歌搜索这个问题,但找不到任何东西。我意识到这是一个很大的要求,但如果有人有任何想法,我会非常高兴。谢谢。
最佳答案
我用
解决了这个问题 <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 的帮助。
关于java - Spring 集成 - SpelEvaluationException : The operator 'ADD' is not supported between objects of type 'java.lang.String' and 'null' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28939254/
我收到多行错误,指出它有重复的类 Duplicate class android.support.v4.accessibilityservice.AccessibilityServiceInfoCom
我的项目昨天运行良好,今天却出现以下错误。请帮忙。 出了什么问题:无法解析配置“:app:debugCompileClasspath”的所有文件。 Could not find support-v4.
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我正在使用 react-native-webrtc 运行示例应用程序模块。我正在尝试在 android 中运行该应用程序,但出现这样的错误... * What went wrong: A probl
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我克隆了我的项目并使用 Android studio 打开,但构建失败并出现以下错误并且同一个项目在其他项目上运行良好。 出了什么问题:无法解析配置“:app:flavorUnsignedReleas
我正在运行示例应用程序......我正在使用 this模块.....但是我收到这样的错误... FAILURE: Build failed with an exception. * What went
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
添加 Android 平台(ionic cordova platform add android)后,我构建了我的 Ionic 项目(ionic cordova build android),但出现错
这个问题在这里已经有了答案: Manifest merger failed : Attribute application@appComponentFactory - Androidx (14 个答
关于我的 Gradle 文件中的以下“complie”: dependencies { compile 'com.android.support:support-v4:25.3.1' }
有些困惑。 我想更频繁地使用@supports 但是...我不关心浏览器如何看待它。希望您能说清楚,如果可以的话谢谢您。 如果浏览器本身不理解@supports,它如何计算@support 'not'
我刚刚升级到 Dart 2 和最新版本的 Flutter,现在我无法构建我的应用程序。我在互联网上环顾四周,但仍然不明白为什么会发生这种情况。 我得到的错误是: FAILURE: Build fail
我正在学习 Firebase,但由于以下错误而陷入困境: Error:Failed to resolve: com.android.support:customtabs:25.4.0 Error:Fa
我在构建本周时出于某种原因尝试使用Cordova进行项目时遇到问题: cordova build android gradle获取com.android.support:support alpha而不
对应的androidx是什么com.android.support:support-compat 的图书馆实现push notifications ? 他们说here它是 androidx 的一部分,
我正在尝试为我的应用设置插桩单元测试。并且我已根据以下开发者站点链接添加了依赖项。 https://developer.android.com/training/testing/unit-testin
当我想使用 Proguard 规则生成签名的 APK(发布)时,我收到了以下错误消息: Cannot find a version of 'com.android.support:support-an
这个问题在这里已经有了答案: Failed to resolve: com.android.support:appcompat-v7:26.0.0 (14 个答案) Failed to resolv
我是一名优秀的程序员,十分优秀!