Java Apache Camel SFTP文件上载不工作

Java Apache Camel SFTP文件上载不工作,java,apache-camel,Java,Apache Camel,程序没有抛出任何异常,但文件被移动到.camel文件夹。它没有上载到服务器位置/tmp/uta/test1。它还表示“上载文件ubuntu.png已完成。”。请帮我找出问题所在 路由器:- @Component public class SampleCamelRouter extends RouteBuilder { @Override public void configure() throws Exception { from("file:C:/Users/D

程序没有抛出任何异常,但文件被移动到.camel文件夹。它没有上载到服务器位置/tmp/uta/test1。它还表示“上载文件ubuntu.png已完成。”。请帮我找出问题所在

路由器:-

@Component
public class SampleCamelRouter extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        from("file:C:/Users/Downloads/test")
        .to("sftp://user@102.108.99.100/tmp/uta/test1?password=password").
         log("Upload file ${file:name} is complete.");
    }
}
route starts..
route ends..

[0     ] - Apache Camel 2.13.0 (CamelContext: camel-1) is starting
[4     ] - Tracing is enabled on CamelContext: camel-1
[5     ] - JMX is enabled
[370   ] - Loaded 175 type converters
[662   ] - AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
[662   ] - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
[725   ] - Route: route1 started and consuming from: Endpoint[file://C:/Users/Downloads/test]
[725   ] - Total 1 routes, of which 1 is started.
[744   ] - Apache Camel 2.13.0 (CamelContext: camel-1) started in 0.730 seconds
[31453 ] - ID-B20GPF2-59231-1501554606358-0-2 >>> (route1) from(file://C:/Users/Downloads/test) --> sftp://leo@102.108.99.100/tmp/uta/test1?password=xxxxxx <<< Pattern:InOnly, Headers:{CamelFileName=cron.png, CamelFileNameOnly=cron.png, CamelFileRelativePath=cron.png, CamelFileAbsolute=true, CamelFileLength=4214, CamelFileAbsolutePath=C:\Users\Downloads\test\cron.png, breadcrumbId=ID-B20GPF2-59231-1501554606358-0-1, CamelFileLastModified=1497248004376, CamelFileParent=C:\Users\Downloads\test, CamelFilePath=C:\Users\Downloads\test\cron.png, CamelFileNameConsumed=cron.png}, BodyType:org.apache.camel.component.file.GenericFile, Body:[Body is file based: GenericFile[C:\Users\Downloads\test\cron.png]]
[31649 ] - JSCH -> Connecting to 102.108.99.100 port 22
[31685 ] - JSCH -> Connection established
[31703 ] - JSCH -> Remote version string: SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
[31703 ] - JSCH -> Local version string: SSH-2.0-JSCH-0.1.50
[31703 ] - JSCH -> CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
[33657 ] - JSCH -> aes256-ctr is not available.
[33657 ] - JSCH -> aes192-ctr is not available.
[33657 ] - JSCH -> aes256-cbc is not available.
[33657 ] - JSCH -> aes192-cbc is not available.
[33657 ] - JSCH -> arcfour256 is not available.
[33658 ] - JSCH -> CheckKexes: diffie-hellman-group14-sha1
[34313 ] - JSCH -> SSH_MSG_KEXINIT sent
[34314 ] - JSCH -> SSH_MSG_KEXINIT received
[34314 ] - JSCH -> kex: server: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
[34314 ] - JSCH -> kex: server: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
[34314 ] - JSCH -> kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[34314 ] - JSCH -> kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[34314 ] - JSCH -> kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[34314 ] - JSCH -> kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[34314 ] - JSCH -> kex: server: none,zlib@openssh.com
[34314 ] - JSCH -> kex: server: none,zlib@openssh.com
[34314 ] - JSCH -> kex: server: 
[34314 ] - JSCH -> kex: server: 
[34314 ] - JSCH -> kex: client: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
[34314 ] - JSCH -> kex: client: ssh-rsa,ssh-dss
[34314 ] - JSCH -> kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
[34315 ] - JSCH -> kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
[34315 ] - JSCH -> kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[34315 ] - JSCH -> kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[34315 ] - JSCH -> kex: client: none
[34315 ] - JSCH -> kex: client: none
[34315 ] - JSCH -> kex: client: 
[34315 ] - JSCH -> kex: client: 
[34315 ] - JSCH -> kex: server->client aes128-ctr hmac-sha1 none
[34315 ] - JSCH -> kex: client->server aes128-ctr hmac-sha1 none
[34337 ] - JSCH -> SSH_MSG_KEXDH_INIT sent
[34337 ] - JSCH -> expecting SSH_MSG_KEXDH_REPLY
[34359 ] - JSCH -> ssh_rsa_verify: signature true
[34364 ] - JSCH -> Permanently added '102.108.99.100' (RSA) to the list of known hosts.
[34365 ] - JSCH -> SSH_MSG_NEWKEYS sent
[34365 ] - JSCH -> SSH_MSG_NEWKEYS received
[34374 ] - JSCH -> SSH_MSG_SERVICE_REQUEST sent
[34375 ] - JSCH -> SSH_MSG_SERVICE_ACCEPT received
[34378 ] - JSCH -> Authentications that can continue: publickey,keyboard-interactive,password
[34379 ] - JSCH -> Next authentication method: publickey
[34380 ] - JSCH -> Authentications that can continue: keyboard-interactive,password
[34380 ] - JSCH -> Next authentication method: keyboard-interactive
[34396 ] - JSCH -> Authentication succeeded (keyboard-interactive).
[34904 ] - Connected to sftp://leo@102.108.99.100:22
[34904 ] - Connected and logged in to: Endpoint[sftp://leo@102.108.99.100/tmp/uta/test1?password=xxxxxx]
[34950 ] - ID-B20GPF2-59231-1501554606358-0-2 >>> (route1) sftp://leo@102.108.99.100/tmp/uta/test1?password=xxxxxx --> log[Upload file ${file:name} is complete.] <<< Pattern:InOnly, Headers:{CamelFileRelativePath=cron.png, breadcrumbId=ID-B20GPF2-59231-1501554606358-0-1, CamelFileLastModified=1497248004376, CamelFileLength=4214, CamelFileName=cron.png, CamelFileNameConsumed=cron.png, CamelFileNameProduced=tmp/uta/test1/cron.png, CamelFileParent=C:\Users\Downloads\test, CamelFileNameOnly=cron.png, CamelFileAbsolute=true, CamelFilePath=C:\Users\Downloads\test\cron.png, CamelFileAbsolutePath=C:\Users\Downloads\test\cron.png}, BodyType:org.apache.camel.component.file.GenericFile, Body:[Body is file based: GenericFile[C:\Users\Downloads\test\cron.png]]
[34950 ] - Upload file cron.png is complete.
更新的日志详细信息:-

@Component
public class SampleCamelRouter extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        from("file:C:/Users/Downloads/test")
        .to("sftp://user@102.108.99.100/tmp/uta/test1?password=password").
         log("Upload file ${file:name} is complete.");
    }
}
route starts..
route ends..

[0     ] - Apache Camel 2.13.0 (CamelContext: camel-1) is starting
[4     ] - Tracing is enabled on CamelContext: camel-1
[5     ] - JMX is enabled
[370   ] - Loaded 175 type converters
[662   ] - AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
[662   ] - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
[725   ] - Route: route1 started and consuming from: Endpoint[file://C:/Users/Downloads/test]
[725   ] - Total 1 routes, of which 1 is started.
[744   ] - Apache Camel 2.13.0 (CamelContext: camel-1) started in 0.730 seconds
[31453 ] - ID-B20GPF2-59231-1501554606358-0-2 >>> (route1) from(file://C:/Users/Downloads/test) --> sftp://leo@102.108.99.100/tmp/uta/test1?password=xxxxxx <<< Pattern:InOnly, Headers:{CamelFileName=cron.png, CamelFileNameOnly=cron.png, CamelFileRelativePath=cron.png, CamelFileAbsolute=true, CamelFileLength=4214, CamelFileAbsolutePath=C:\Users\Downloads\test\cron.png, breadcrumbId=ID-B20GPF2-59231-1501554606358-0-1, CamelFileLastModified=1497248004376, CamelFileParent=C:\Users\Downloads\test, CamelFilePath=C:\Users\Downloads\test\cron.png, CamelFileNameConsumed=cron.png}, BodyType:org.apache.camel.component.file.GenericFile, Body:[Body is file based: GenericFile[C:\Users\Downloads\test\cron.png]]
[31649 ] - JSCH -> Connecting to 102.108.99.100 port 22
[31685 ] - JSCH -> Connection established
[31703 ] - JSCH -> Remote version string: SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
[31703 ] - JSCH -> Local version string: SSH-2.0-JSCH-0.1.50
[31703 ] - JSCH -> CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
[33657 ] - JSCH -> aes256-ctr is not available.
[33657 ] - JSCH -> aes192-ctr is not available.
[33657 ] - JSCH -> aes256-cbc is not available.
[33657 ] - JSCH -> aes192-cbc is not available.
[33657 ] - JSCH -> arcfour256 is not available.
[33658 ] - JSCH -> CheckKexes: diffie-hellman-group14-sha1
[34313 ] - JSCH -> SSH_MSG_KEXINIT sent
[34314 ] - JSCH -> SSH_MSG_KEXINIT received
[34314 ] - JSCH -> kex: server: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
[34314 ] - JSCH -> kex: server: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
[34314 ] - JSCH -> kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[34314 ] - JSCH -> kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[34314 ] - JSCH -> kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[34314 ] - JSCH -> kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[34314 ] - JSCH -> kex: server: none,zlib@openssh.com
[34314 ] - JSCH -> kex: server: none,zlib@openssh.com
[34314 ] - JSCH -> kex: server: 
[34314 ] - JSCH -> kex: server: 
[34314 ] - JSCH -> kex: client: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
[34314 ] - JSCH -> kex: client: ssh-rsa,ssh-dss
[34314 ] - JSCH -> kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
[34315 ] - JSCH -> kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
[34315 ] - JSCH -> kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[34315 ] - JSCH -> kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[34315 ] - JSCH -> kex: client: none
[34315 ] - JSCH -> kex: client: none
[34315 ] - JSCH -> kex: client: 
[34315 ] - JSCH -> kex: client: 
[34315 ] - JSCH -> kex: server->client aes128-ctr hmac-sha1 none
[34315 ] - JSCH -> kex: client->server aes128-ctr hmac-sha1 none
[34337 ] - JSCH -> SSH_MSG_KEXDH_INIT sent
[34337 ] - JSCH -> expecting SSH_MSG_KEXDH_REPLY
[34359 ] - JSCH -> ssh_rsa_verify: signature true
[34364 ] - JSCH -> Permanently added '102.108.99.100' (RSA) to the list of known hosts.
[34365 ] - JSCH -> SSH_MSG_NEWKEYS sent
[34365 ] - JSCH -> SSH_MSG_NEWKEYS received
[34374 ] - JSCH -> SSH_MSG_SERVICE_REQUEST sent
[34375 ] - JSCH -> SSH_MSG_SERVICE_ACCEPT received
[34378 ] - JSCH -> Authentications that can continue: publickey,keyboard-interactive,password
[34379 ] - JSCH -> Next authentication method: publickey
[34380 ] - JSCH -> Authentications that can continue: keyboard-interactive,password
[34380 ] - JSCH -> Next authentication method: keyboard-interactive
[34396 ] - JSCH -> Authentication succeeded (keyboard-interactive).
[34904 ] - Connected to sftp://leo@102.108.99.100:22
[34904 ] - Connected and logged in to: Endpoint[sftp://leo@102.108.99.100/tmp/uta/test1?password=xxxxxx]
[34950 ] - ID-B20GPF2-59231-1501554606358-0-2 >>> (route1) sftp://leo@102.108.99.100/tmp/uta/test1?password=xxxxxx --> log[Upload file ${file:name} is complete.] <<< Pattern:InOnly, Headers:{CamelFileRelativePath=cron.png, breadcrumbId=ID-B20GPF2-59231-1501554606358-0-1, CamelFileLastModified=1497248004376, CamelFileLength=4214, CamelFileName=cron.png, CamelFileNameConsumed=cron.png, CamelFileNameProduced=tmp/uta/test1/cron.png, CamelFileParent=C:\Users\Downloads\test, CamelFileNameOnly=cron.png, CamelFileAbsolute=true, CamelFilePath=C:\Users\Downloads\test\cron.png, CamelFileAbsolutePath=C:\Users\Downloads\test\cron.png}, BodyType:org.apache.camel.component.file.GenericFile, Body:[Body is file based: GenericFile[C:\Users\Downloads\test\cron.png]]
[34950 ] - Upload file cron.png is complete.
路线开始。。
路线结束。。
[0]-Apache Camel 2.13.0(CamelContext:Camel-1)正在启动
[4]-在CamelContext:camel-1上启用跟踪
[5]-已启用JMX
[370]-负载175型转换器
[662]-AllowUseOriginalMessage已启用。如果不需要访问原始消息,则建议关闭此选项,因为它可能会提高性能。
[662]-未使用StreamCaching。如果使用流,则建议启用流缓存。有关更多详细信息,请参阅http://camel.apache.org/stream-caching.html
[725]-路由:route1从以下位置启动和使用:端点[file://C:/Users/Downloads/test]
[725]-总共1条路由,其中1条已启动。
[744]-Apache Camel 2.13.0(CamelContext:Camel-1)在0.730秒内启动
[31453]-ID-B20GPF2-59231-1501554606358-0-2>>>(路由1)来自(文件://C:/Users/Downloads/test)-->sftp://leo@102.108.99.100/tmp/uta/test1?密码=xxxxxx已建立连接
[31703]-JSCH->远程版本字符串:SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
[31703]-JSCH->本地版本字符串:SSH-2.0-JSCH-0.1.50
[31703]-JSCH->校验密码:aes256 ctr、aes192 ctr、aes128 ctr、aes256 cbc、aes192 cbc、aes128 cbc、3des ctr、ARCFORE、ARCFOR128、ARCFOR256
[33657]-JSCH->aes256 ctr不可用。
[33657]-JSCH->aes192 ctr不可用。
[33657]-JSCH->aes256 cbc不可用。
[33657]-JSCH->aes192 cbc不可用。
[33657]-JSCH->arcfour256不可用。
[33658]-JSCH->CheckKexes:diffie-hellman-group14-sha1
[34313]-JSCH->SSH\u MSG\u KEXINIT已发送
[34314]-JSCH->SSH\u MSG\u KEXINIT收到
[34314]-JSCH->kex:server:curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
[34314]-JSCH->kex:server:ssh-rsa、rsa-sha2-512、rsa-sha2-256、ecdsa-sha2-nistp256、ssh-ed25519
[34314]-JSCH->kex:server:chachacha20-poly1305@openssh.com,aes128中心,aes192中心,aes256中心,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[34314]-JSCH->kex:server:chachacha20-poly1305@openssh.com,aes128中心,aes192中心,aes256中心,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[34314]-JSCH->kex:服务器:umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[34314]-JSCH->kex:服务器:umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[34314]-JSCH->kex:server:none,zlib@openssh.com
[34314]-JSCH->kex:server:none,zlib@openssh.com
[34314]-JSCH->kex:服务器:
[34314]-JSCH->kex:服务器:
[34314]-JSCH->kex:客户端:diffie-hellman-group1-sha1、diffie-hellman-group14-sha1、diffie-hellman-group-exchange-sha1
[34314]-JSCH->kex:client:ssh-rsa,ssh-dss
[34314]-JSCH->kex:客户机:aes128控制中心、aes128控制中心、3des控制中心、3des控制中心、河豚控制中心
[34315]-JSCH->kex:客户机:aes128控制中心、aes128控制中心、3des控制中心、3des控制中心、河豚控制中心
[34315]-JSCH->kex:客户端:hmac-md5、hmac-sha1、hmac-sha2-256、hmac-sha1-96、hmac-md5-96
[34315]-JSCH->kex:客户端:hmac-md5、hmac-sha1、hmac-sha2-256、hmac-sha1-96、hmac-md5-96
[34315]-JSCH->kex:客户端:无
[34315]-JSCH->kex:客户端:无
[34315]-JSCH->kex:客户端:
[34315]-JSCH->kex:客户端:
[34315]-JSCH->kex:服务器->客户端aes128 ctr hmac-sha1无
[34315]-JSCH->kex:客户端->服务器aes128 ctr hmac-sha1无
[34337]-JSCH->SSH\u MSG\u KEXDH\u INIT已发送
[34337]-JSCH->期待SSH\u MSG\u KEXDH\u回复
[34359]-JSCH->ssh\u rsa\u验证:签名为真
[34364]-JSCH->将“102.108.99.100”(RSA)永久添加到已知主机列表中。
[34365]-JSCH->SSH\u MSG\u已发送新密钥
[34365]-JSCH->SSH\u MSG\u收到新密钥
[34374]-JSCH->SSH\u消息\u服务\u请求已发送
[34375]-JSCH->SSH\u消息\u服务\u接收
[34378]-JSCH->可以继续的身份验证:公钥、键盘交互、密码
[34379]-JSCH->下一个身份验证方法:公钥
[34380]-JSCH->可以继续的身份验证:键盘交互、密码
[34380]-JSCH->下一个身份验证方法:键盘交互
[34396]-JSCH->身份验证成功(键盘交互)。
[34904]-连接到sftp://leo@102.108.99.100:22
[34904]-已连接并登录到:端点[sftp://leo@102.108.99.100/tmp/uta/test1?密码=xxxxxx]

[34950]-ID-B20GPF2-59231-1501554606358-0-2>>>(路由1)sftp://leo@102.108.99.100/tmp/uta/test1?password=xxxxxx-->日志[上传文件${file:name}已完成。]文件将移动到运行camel应用程序的计算机上的
.camel
子文件夹。这就是Camel文件组件开箱即用的工作方式(请参见移动选项)

骆驼路线中使用的FTP组件应该上载文件。那么,您是否检查了FTP服务器端是否有上载的文件。您可以从FTP服务器检查日志


您还可以尝试在Camel应用程序上启用调试/跟踪日志记录,以查看正在记录的内容

文件将移动到运行camel应用程序的计算机上的
.camel
子文件夹中。这就是Camel文件组件开箱即用的工作方式(请参见移动选项)

骆驼路线中使用的FTP组件应该上载文件。那么,您是否检查了FTP服务器端是否有上载的文件。您可以从FTP服务器检查日志