我需要创建一个将文件从本地传输到远程SFTP服务器的应用程序。我必须使用Spring Integration来完成它,我遵循文档,但我无法使其工作。当我运行它总是得到错误:
may 15, 2017 12:15:37 PM com.test.tt.file.sftp.out.SftpFileManager main
SEVERE: exporting...
may 15, 2017 12:15:37 PM com.test.tt.file.sftp.out.SftpFileManager exportFile
INFO: <<< at SftpFileManager.exportFile >>>
may 15, 2017 12:15:37 PM com.test.tt.file.sftp.out.SftpFileManager exportFile
INFO: SftpFileManager.localDirectory => C:\temp\test\test.xml
may 15, 2017 12:15:37 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@351787ea: startup date [Mon May 15 12:15:37 CDT 2017]; root of context hierarchy
may 15, 2017 12:15:37 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/spring/integration/SftpFileManager-context.xml]
may 15, 2017 12:15:37 PM org.springframework.beans.factory.config.PropertiesFactoryBean loadProperties
INFO: Loading properties file from URL [jar:file:/C:/Users/user/.m2/repository/org/springframework/integration/spring-integration-core/4.1.6.RELEASE/spring-integration-core-4.1.6.RELEASE.jar!/META-INF/spring.integration.default.properties]
may 15, 2017 12:15:37 PM org.springframework.integration.config.IntegrationRegistrar registerHeaderChannelRegistry
INFO: No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
may 15, 2017 12:15:38 PM org.springframework.context.support.PropertySourcesPlaceholderConfigurer loadProperties
INFO: Loading properties file from class path resource [sftp.properties]
may 15, 2017 12:15:38 PM org.springframework.integration.config.DefaultConfiguringBeanFactoryPostProcessor registerErrorChannel
INFO: No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
may 15, 2017 12:15:38 PM org.springframework.integration.config.DefaultConfiguringBeanFactoryPostProcessor registerTaskScheduler
INFO: No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
may 15, 2017 12:15:38 PM org.springframework.beans.factory.config.PropertiesFactoryBean loadProperties
INFO: Loading properties file from URL [jar:file:/C:/Users/user/.m2/repository/org/springframework/integration/spring-integration-core/4.1.6.RELEASE/spring-integration-core-4.1.6.RELEASE.jar!/META-INF/spring.integration.default.properties]
may 15, 2017 12:15:38 PM org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler initialize
INFO: Initializing ExecutorService 'taskScheduler'
may 15, 2017 12:15:38 PM org.springframework.context.support.DefaultLifecycleProcessor start
INFO: Starting beans in phase -2147483648
may 15, 2017 12:15:38 PM org.springframework.context.support.DefaultLifecycleProcessor start
INFO: Starting beans in phase 0
may 15, 2017 12:15:38 PM org.springframework.integration.endpoint.EventDrivenConsumer logComponentSubscriptionEvent
INFO: Adding {message-handler:sftpOutboundAdapter} as a subscriber to the 'inputChannel' channel
may 15, 2017 12:15:38 PM org.springframework.integration.channel.DirectChannel adjustCounterIfNecessary
INFO: Channel 'org.springframework.context.support.ClassPathXmlApplicationContext@351787ea.inputChannel' has 1 subscriber(s).
may 15, 2017 12:15:38 PM org.springframework.integration.endpoint.EventDrivenConsumer start
INFO: started sftpOutboundAdapter
may 15, 2017 12:15:38 PM org.springframework.integration.endpoint.EventDrivenConsumer logComponentSubscriptionEvent
INFO: Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
may 15, 2017 12:15:38 PM org.springframework.integration.channel.PublishSubscribeChannel adjustCounterIfNecessary
INFO: Channel 'org.springframework.context.support.ClassPathXmlApplicationContext@351787ea.errorChannel' has 1 subscriber(s).
may 15, 2017 12:15:38 PM org.springframework.integration.endpoint.EventDrivenConsumer start
INFO: started _org.springframework.integration.errorLogger
may 15, 2017 12:15:38 PM com.jcraft.jsch log
INFO: Connecting to REMOTE.IP port 22
may 15, 2017 12:15:38 PM com.jcraft.jsch log
INFO: Connection established
may 15, 2017 12:15:38 PM com.jcraft.jsch log
INFO: Remote version string: SSH-2.0-OpenSSH_4.3
may 15, 2017 12:15:38 PM com.jcraft.jsch log
INFO: Local version string: SSH-2.0-JSCH-0.1.52
may 15, 2017 12:15:38 PM com.jcraft.jsch log
INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: aes256-ctr is not available.
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: aes192-ctr is not available.
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: aes256-cbc is not available.
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: aes192-cbc is not available.
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: diffie-hellman-group14-sha1 is not available.
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXINIT sent
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXINIT received
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server: ssh-rsa,ssh-dss
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server: none,zlib@openssh.com
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server: none,zlib@openssh.com
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server:
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server:
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client: none
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client: none
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client:
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client:
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: server->client aes128-ctr hmac-md5 none
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: kex: client->server aes128-ctr hmac-md5 none
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXDH_INIT sent
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: expecting SSH_MSG_KEXDH_REPLY
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: ssh_rsa_verify: signature true
may 15, 2017 12:15:39 PM com.jcraft.jsch log
WARNING: Permanently added 'REMOTE.IP' (RSA) to the list of known hosts.
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: SSH_MSG_NEWKEYS sent
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: SSH_MSG_NEWKEYS received
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: SSH_MSG_SERVICE_REQUEST sent
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: SSH_MSG_SERVICE_ACCEPT received
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: Authentications that can continue: gssapi-with-mic,publickey,keyboard-interactive,password
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: Next authentication method: gssapi-with-mic
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: Authentications that can continue: publickey,keyboard-interactive,password
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: Next authentication method: publickey
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: Authentications that can continue: password
may 15, 2017 12:15:39 PM com.jcraft.jsch log
INFO: Next authentication method: password
may 15, 2017 12:15:52 PM com.jcraft.jsch log
INFO: Disconnecting from REMOTE.IP port 22
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Connecting to REMOTE.IP port 22
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Connection established
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Remote version string: SSH-2.0-OpenSSH_4.3
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Local version string: SSH-2.0-JSCH-0.1.52
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: aes256-ctr is not available.
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: aes192-ctr is not available.
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: aes256-cbc is not available.
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: aes192-cbc is not available.
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: diffie-hellman-group14-sha1 is not available.
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXINIT sent
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXINIT received
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server: ssh-rsa,ssh-dss
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server: none,zlib@openssh.com
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server: none,zlib@openssh.com
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server:
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server:
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client: none
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client: none
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client:
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client:
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: server->client aes128-ctr hmac-md5 none
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: kex: client->server aes128-ctr hmac-md5 none
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXDH_INIT sent
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: expecting SSH_MSG_KEXDH_REPLY
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: ssh_rsa_verify: signature true
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Host 'REMOTE.IP' is known and matches the RSA host key
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: SSH_MSG_NEWKEYS sent
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: SSH_MSG_NEWKEYS received
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: SSH_MSG_SERVICE_REQUEST sent
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: SSH_MSG_SERVICE_ACCEPT received
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Authentications that can continue: gssapi-with-mic,publickey,keyboard-interactive,password
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Next authentication method: gssapi-with-mic
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Authentications that can continue: publickey,keyboard-interactive,password
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Next authentication method: publickey
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Authentications that can continue: password
may 15, 2017 12:15:53 PM com.jcraft.jsch log
INFO: Next authentication method: password
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: Disconnecting from REMOTE.IP port 22
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: Connecting to REMOTE.IP port 22
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: Connection established
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: Remote version string: SSH-2.0-OpenSSH_4.3
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: Local version string: SSH-2.0-JSCH-0.1.52
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: aes256-ctr is not available.
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: aes192-ctr is not available.
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: aes256-cbc is not available.
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: aes192-cbc is not available.
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: diffie-hellman-group14-sha1 is not available.
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXINIT sent
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXINIT received
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server: ssh-rsa,ssh-dss
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server: none,zlib@openssh.com
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server: none,zlib@openssh.com
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server:
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server:
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client: none
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client: none
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client:
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client:
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: server->client aes128-ctr hmac-md5 none
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: kex: client->server aes128-ctr hmac-md5 none
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: SSH_MSG_KEXDH_INIT sent
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: expecting SSH_MSG_KEXDH_REPLY
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: ssh_rsa_verify: signature true
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: Host 'REMOTE.IP' is known and matches the RSA host key
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: SSH_MSG_NEWKEYS sent
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: SSH_MSG_NEWKEYS received
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: SSH_MSG_SERVICE_REQUEST sent
may 15, 2017 12:16:07 PM com.jcraft.jsch log
INFO: SSH_MSG_SERVICE_ACCEPT received
may 15, 2017 12:16:08 PM com.jcraft.jsch log
INFO: Authentications that can continue: gssapi-with-mic,publickey,keyboard-interactive,password
may 15, 2017 12:16:08 PM com.jcraft.jsch log
INFO: Next authentication method: gssapi-with-mic
may 15, 2017 12:16:08 PM com.jcraft.jsch log
INFO: Authentications that can continue: publickey,keyboard-interactive,password
may 15, 2017 12:16:08 PM com.jcraft.jsch log
INFO: Next authentication method: publickey
may 15, 2017 12:16:08 PM com.jcraft.jsch log
INFO: Authentications that can continue: password
may 15, 2017 12:16:08 PM com.jcraft.jsch log
INFO: Next authentication method: password
may 15, 2017 12:16:20 PM com.jcraft.jsch log
INFO: Disconnecting from REMOTE.IP port 22
may 15, 2017 12:16:20 PM com.test.tt.file.sftp.out.SftpFileManager exportFile
SEVERE: org.springframework.messaging.MessagingException: ; nested exception is org.springframework.messaging.MessagingException: Failed to obtain pooled item; nested exception is java.lang.IllegalStateException: failed to create SFTP Session
我检查了凭据,但这不是问题。请你帮助我好吗?还是分享一个例子?
我的配置: 的 SftpFileManager-context.xml中
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/sftp
http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
"
>
<!-- <import resource="SftpCommon.xml"/> -->
<context:property-placeholder location="classpath:sftp.properties"/>
<bean id="sftpSessionFactory" class="org.springframework.integration.file.remote.session.CachingSessionFactory">
<constructor-arg ref="defaultsftpSessionFactory" />
<property name="poolSize" value="${poolSize}"/>
<property name="sessionWaitTimeout" value="${sessionWaitTimeout}"/>
</bean>
<bean id="sftpFileManager" class="com.test.tt.file.sftp.out.SftpFileManager" />
<bean id="defaultsftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="${host}"/>
<property name="port" value="${port}"/>
<property name="user" value="${username}"/>
<property name="password" value="${password}"/>
<!-- <property name="allowUnknownKeys" value="true"/> -->
</bean>
<int:channel id="inputChannel"/>
<int-sftp:outbound-channel-adapter id="sftpOutboundAdapter"
session-factory="sftpSessionFactory"
channel="inputChannel"
remote-file-separator="/"
remote-directory="${remote.directory}"
mode="REPLACE">
<int-sftp:request-handler-advice-chain>
<!-- <bean class="org.springframework.integration.handler.advice.RequestHandlerRetryAdvice" >
<property name="retryPolicy">
<bean class="org.springframework.retry.policy.SimpleRetryPolicy">
<property name="maxAttempts" value="${retry.maxAttempts}" />
</bean>
</property>
</bean> -->
<int:retry-advice />
</int-sftp:request-handler-advice-chain>
</int-sftp:outbound-channel-adapter>
<bean id="fileNameGenerator" class="org.springframework.integration.file.DefaultFileNameGenerator" />
<bean id="SftpFileManager" class="com.test.tt.file.sftp.out.SftpFileManager">
<property name="inputChannel" ref="inputChannel" />
</bean>
</beans>
我的班级SftpFileManager.java
public class SftpFileManager {
protected static Log log = LogFactory.getLog(SftpFileManager.class);
private MessageChannel inputChannel;
public boolean exportFile(String pathName) throws Exception {
log.info("<<< at SftpFileManager.exportFile >>>");
log.info("SftpFileManager.localDirectory => " + pathName);
final ApplicationContext context = new ClassPathXmlApplicationContext(
"/META-INF/spring/integration/SftpFileManager-context.xml");
try {
final File file = new File(pathName);
Assert.isTrue(file.exists(), String.format("File '%s' does not exist.", pathName));
final Message<File> message = MessageBuilder.withPayload(file).build();
inputChannel = context.getBean("inputChannel", MessageChannel.class);
inputChannel.send(message);
log.info(String.format("Successfully transferred '%s' file to a " + " server under the name '%s'",
pathName, pathName));
} catch (Exception ex) {
log.error(ex);
} finally {
}
return false;
}
public static void main(String [] args){
try{
SftpFileManager sftp = new SftpFileManager();
log.error("exporting...");
sftp.exportFile("C:\\temp\\test\\test.xml");
}catch(Exception ex){
log.error("SftpFileManageraa.Error!!!!!!!!!!!" + ex);
}
}
public MessageChannel getInputChannel() {
return inputChannel;
}
public void setInputChannel(MessageChannel inputChannel) {
this.inputChannel = inputChannel;
}
}