Apache camel 用户名中的camel sftp特殊字符

Apache camel 用户名中的camel sftp特殊字符,apache-camel,sftp,Apache Camel,Sftp,我正在使用ApacheCamel 2.13.2,并尝试连接到用户名中有特殊字符的sftp。用户名类似于“XXX\XX-XXXXXXX”。最后的驼峰URL被转换为如下内容,身份验证失败。有人能解释一下如何处理用户名中的这些特殊字符吗 Endpoint[sftp://XXX%5CXX-xxxxxxx@99.999.99.99:22//folder_Test/?binary=true&consumer.bridgeErrorHandler=true&delay=15000&id

我正在使用ApacheCamel 2.13.2,并尝试连接到用户名中有特殊字符的sftp。用户名类似于“XXX\XX-XXXXXXX”。最后的驼峰URL被转换为如下内容,身份验证失败。有人能解释一下如何处理用户名中的这些特殊字符吗

Endpoint[sftp://XXX%5CXX-xxxxxxx@99.999.99.99:22//folder_Test/?binary=true&consumer.bridgeErrorHandler=true&delay=15000&idempotent=true&idempotentKey=%24%7Bfile%3Aname%7D-%24%7Bfile%3Asize%7D-%24%7Bfile%3Amodified%7D&include=.*Test.*&maxMessagesPerPoll=30&password=xxxxxx&pollStrategy=%23FTPPollingConsumerPollStrategy&readLock=changed&sendEmptyMessageWhenIdle=true&stepwise=false&throwExceptionOnConnectFailed=true] 
下面是我在日志中看到的例外情况

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot connect to sftp://XXX\XX-XXXXX@99.999.99.99:22
    at org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:143)
    at org.apache.camel.component.file.remote.RemoteFileConsumer.connectIfNecessary(RemoteFileConsumer.java:154)
    at org.apache.camel.component.file.remote.RemoteFileConsumer.recoverableConnectIfNecessary(RemoteFileConsumer.java:145)
    at org.apache.camel.component.file.remote.RemoteFileConsumer.prePollCheck(RemoteFileConsumer.java:55)
    at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:106)
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)
    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.jcraft.jsch.JSchException: Auth fail
    at com.jcraft.jsch.Session.connect(Session.java:512)
    at org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:115)
    ... 15 more

使用fileZilla或Apache FTP实用程序时,sftp的相同凭据也会起作用。

请参阅有关如何配置端点的文档,特别是有关密码的文档:您需要在其中使用原始语法。您可以使用原始语法将用户名/密码指定为uri参数,而不是在uri的开头。

请参阅如何配置端点的文档,特别是关于密码的文档:您需要使用原始语法的地方。您可以使用RAW语法将用户名/密码指定为uri参数,而不是在uri的开头。

我曾尝试使用RAW作为用户名,但没有成功,导致相同的身份验证错误。我还可以尝试其他想法吗?使用RAW和用户名作为参数很有效,也就是说,不用username@sftp://主机:如果使用sftp://host:port?username=RAWXXXX 它起作用了。但字符\仍然是一个问题,即使在使用RAW时,它也不会进行身份验证。到目前为止我很喜欢Camel,但就这一个场景而言,我必须找到另一种连接、下载和上传文件的方法:在你的帖子中遇到一个问题,我在用户名和原始文件中遇到了特殊字符。感谢邮政克劳斯!我曾尝试使用RAW作为用户名,但由于出现相同的身份验证错误,因此无效。我还可以尝试其他想法吗?使用RAW和用户名作为参数很有效,也就是说,不用username@sftp://主机:如果使用sftp://host:port?username=RAWXXXX 它起作用了。但字符\仍然是一个问题,即使在使用RAW时,它也不会进行身份验证。到目前为止我很喜欢Camel,但就这一个场景而言,我必须找到另一种连接、下载和上传文件的方法:在你的帖子中遇到一个问题,我在用户名和原始文件中遇到了特殊字符。感谢邮政克劳斯!