从FTP收件箱中读取的FileReadingMessageSource属性是什么?
我们尝试读取的FTP收件箱位置在这里:/ users / chroot / mecssn / incoming / archive。此目录由运行WebSphere的wasadm用户拥有,并且具有上述目录的用户和组权限,因此我认为这不是下面显示的错误的权限问题。
如果我们告诉FileReadingMessageSource使用虚拟目录,比如'lljljh',它会在WebSphere的app服务器中创建这个目录:/apps/WebSphere/AppServer-8.5/profiles/AppSrv01/lljljh。也许它是一个需要设置为允许在app服务器目录之外工作的WebSphere设置?
在Windows上,它适用于测试结构C:\ cvs \ ssn \ archive,它也位于我们正在测试的Tomcat容器的Web应用程序之外
使用此代码时出现错误:
@Bean
@InboundChannelAdapter(value = "ssnInboundFileChannel", poller = @Poller(cron="${mec/SSN_POLLER}"))
public MessageSource<File> fileMessageSourceSSN() {
System.out.println("Creating bean definition for ssnInboundFileChannel");
FileReadingMessageSource source = initialSetUp();
source.setDirectory(new File(mecProperty.getProperty(MecConstants.SSN_SFTP_WORKING_DIR)));
System.out.println("enter fileMessageSource in following dir....." + mecProperty.getProperty(MecConstants.SSN_SFTP_WORKING_DIR));
return source;
}
Caused by: java.lang.IllegalArgumentException: Source directory [/users/chroot/mecssn/incoming/archive] does not exist.
at org.springframework.util.Assert.isTrue(Assert.java:65)
at org.springframework.integration.file.FileReadingMessageSource.onInit(FileReadingMessageSource.java:237)
at org.springframework.integration.context.IntegrationObjectSupport.afterPropertiesSet(IntegrationObjectSupport.java:150)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
... 82 more
更新
原来是一个权限问题。这些权限修复了它:
drwxrws--- 4 mecssn wasadm 4096 Sep 17 17:19 .
drwxr-x--- 3 root mecssn 4096 Aug 27 15:05 ..
drwx------ 2 wasadm sftpchrt 4096 Sep 17 17:19 archive
drwxrwx--- 2 wasadm wasadm 4096 Sep 14 17:01 logs
关键是chmod g + s传入
据说这是WAS应用服务器的已知问题。由于WASADM是组mecssn的一部分,因此它仅在UNIX会话中。但是当Nodeagent从控制台启动Java应用程序时,它不会读取WASADM组。它只看到WASADM帐户及其主要组,即WASADM。