例外:
原因: java.lang.IllegalArgumentException: EvaluationContext を null にすることはできません
スタックトレース
Error creating bean with name 'sftpMessageSource_DebitNotification_SE' defined in com.canaldigital.tsi.bank.xml.config.BankFtpListner: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: evaluationContext must not be null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sftpMessageSource_DebitNotification_SE' defined in com.canaldigital.tsi.bank.xml.config.BankFtpListner: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: evaluationContext must not be null
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134)
at com.canaldigital.tsi.core.CoreRunner.run(CoreRunner.java:29)
at com.canaldigital.tsi.bank.xml.App.main(App.java:18)
Caused by: java.lang.IllegalArgumentException: evaluationContext must not be null
at org.springframework.util.Assert.notNull(Assert.java:115)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.afterPropertiesSet(AbstractInboundFileSynchronizer.java:154)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.afterPropertiesSet(AbstractInboundFileSynchronizingMessageSource.java:151)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 16 more
コード
public SessionFactory<LsEntry> sftpSessionFactory_listener() {
DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory();
System.out.println("sftp host is::" + env.getProperty("sftp.host"));
factory.setPrivateKey(sftpKeyResourceAdapter());
factory.setHost(env.getProperty("sftp.host"));
factory.setUser(env.getProperty("sftp.username"));
factory.setPort(Integer.valueOf(env.getProperty("sftp.serverPort")));
logger.debug("SFTP Session:::"+factory.getSession().isOpen());
return new CachingSessionFactory<LsEntry>(factory);
}
public SftpInboundFileSynchronizer sftpInboundFileSynchronizer_DebitNotification_SE() {
SftpInboundFileSynchronizer debitFileSynchronizer = new SftpInboundFileSynchronizer(sftpSessionFactory_listener());
logger.debug("sftpInboundFileSynchronizer_DebitNotification_SE Starts");
debitFileSynchronizer.setDeleteRemoteFiles(true);
try {
debitFileSynchronizer.setRemoteDirectory(remot );
CompositeFileListFilter<LsEntry> debitFilters = new CompositeFileListFilter<>();
debitFilters.addFilter(new AcceptOnceFileListFilter());
debitFilters.addFilter(new SftpSimplePatternFileListFilter(ibs2BankConfigDAO.getApplicationConfiguration().get(
"SE_CAMT_054d_FILE_NAME_PATTERN")));
debitFilters.addFilter(lastModifiedFileFilter());
debitFileSynchronizer.setFilter(debitFilters);
} catch (IBS2BankException e) {
logger.error("Error creating sftpInboundFileSynchronizer_DebitNotification_SE::" + e.getMessage());
} catch (Exception e) {
logger.debug("Error is:::"+e.getMessage());
}
return debitFileSynchronizer;
}
@InboundChannelAdapter(value = "bankRequestListenerDebitNotification_SE", poller = @Poller(fixedDelay = "10000"))
@Bean
public MessageSource<File> sftpMessageSource_DebitNotification_SE() {
logger.debug("sftpMessageSource_DebitNotification_SE Starts");
SftpInboundFileSynchronizingMessageSource source = new SftpInboundFileSynchronizingMessageSource(
sftpInboundFileSynchronizer_DebitNotification_SE());
logger.debug("sftpMessageSource_DebitNotification_SE Starts1");
source.setAutoCreateLocalDirectory(true);
source.setLocalDirectory(new File("/ibs2bank/Temp_Download/Nordea/CAMT054D/SE"));
logger.debug("sftpMessageSource_DebitNotification_SE Starts2");
logger.debug("sftpMessageSource_DebitNotification_SE Starts3");
source.setLocalFilter(new AcceptOnceFileListFilter<File>());
logger.debug("sftpMessageSource_DebitNotification_SE Starts4");
return source;
}
@Bean
public PollableChannel bankRequestListenerDebitNotification_SE() {
return new QueueChannel();
}