1

filesTobeParsedHolder 包含一个 map ,它基于键,将返回一个 arrayList 对象,它是一个文件名列表。上面的 spring 批处理配置在 Windows 上运行良好。但是相同的代码在 unix/linux 上不起作用并显示以下错误:

ERROR 2013-10-17 03:45:19,851 [SimpleAsyncTaskExecutor-17] AbstractStep - Encountered an error executing the step
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lazyBindingProxy.generalProfilingLogMRI#sys
init' defined in class path resource [GeneralExtractJobs/generalExtractJob.xml]: Initialization of bean failed; nested exception is
 java.lang.IllegalStateException: Cannot bind to placeholder: filesTobeParsedHolder.get(stepExecutionContext['date.as.yyyyMMdd'].co
ncat('.').concat(stepExecutionContext['instance']))
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac
tory.java:480)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja
va:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFacto
ry.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:302)
        at org.springframework.batch.core.scope.StepScope.get(StepScope.java:150)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.batch.core.scope.util.PlaceholderTargetSource.getTarget(PlaceholderTargetSource.java:185)

<bean id="generalProfilingLogMRI"    class="org.springframework.batch.item.file.MultiResourceItemReader" scope="step">
       <property name="resources" value="#{filesTobeParsedHolder.get(stepExecutionContext['date.as.yyyyMMdd'].concat('.').concat(stepExecutionContext['instance']))}"/>
       <property name="delegate" ref="generalProfilingLogFileItemReader" />
</bean>
4

0 回答 0