英文:
Apache Camel SFTP is asking for Username and Password in the console
问题
尽管我添加了 username
和 password
,但Camel路由仍然在控制台上要求输入用户名和密码。
依赖项 -
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>3.20.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-ftp</artifactId>
<version>3.20.1</version>
</dependency>
Camel路由 -
URI uri = new URIBuilder().setScheme("sftp").setHost("HOST.com").setPort(22)
.setUser("demo_user", "demo_password").build();
from(uri.toString()).to("file://src/main/resources);
在控制台运行后,显示如下 -
19:01:41:158 [main] WARN o.a.c.c.file.remote.SftpOperations - JSCH
Kerberos username:
我希望运行应用程序时,username
和 password
应该自动填入,但不幸的是它没有自动填入。是否有任何解决方案?
英文:
Though I've added a username
and password
still camel route is asking for a username and password in the console.
Dependency -
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>3.20.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-ftp</artifactId>
<version>3.20.1</version>
</dependency>
Camel Route -
URI uri = new URIBuilder().setScheme("sftp").setHost("HOST.com").setPort(22)
.setUser("demo_user", "demo_password").build();
from(uri.toString()).to("file://src/main/resources);
After running this in the console it's showing -
19:01:41:158 [main] WARN o.a.c.c.file.remote.SftpOperations - JSCH
Kerberos username:
I want to run the application and the username
& password
should automatically take but sadly it's not taking, any solution, please
答案1
得分: 1
我得到了解决方案。
我传递了一个参数 - preferredAuthentications
,设为 password
,之后它就能工作了。
URI uri = new URIBuilder().setScheme("sftp").setHost("HOST.com").setPort(22)
.setUser("demo_user", "demo_password").addParameter("preferredAuthentications", "password").build();
英文:
Finally, I got the solution.
I passed a parameter - preferredAuthentications
as password
and after that, it's working
URI uri = new URIBuilder().setScheme("sftp").setHost("HOST.com").setPort(22)
.setUser("demo_user", "demo_password").addParameter("preferredAuthentications", "password").build();
答案2
得分: 0
from("sftp://HOST.com:22?username=demo_user&password=demo_password")
.to("file://src/main/resources");
英文:
You can try
from("sftp://HOST.com:22?username=demo_user&password=demo_password")
.to("file://src/main/resources");
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论