You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by geetha <ha...@gmail.com> on 2014/04/04 13:48:41 UTC

Exception not thrown while doing sftp inside consumer.receive

Hi,

If i use sftp inside from uri, am getting exceptions like this

*For invalid username *- 
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
connect to sftp://abcd@localhost: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.prePollCheck(RemoteFileConsumer.java:57)
	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(Executors.java:471)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 2 Too many
authentication failures for abcd
	at com.jcraft.jsch.Session.read(Session.java:938)
	at com.jcraft.jsch.UserAuthPassword.start(UserAuthPassword.java:91)
	at com.jcraft.jsch.Session.connect(Session.java:442)
	at
org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:115)

*For invalid hostname* - 

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
connect to sftp://root@abcd: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.prePollCheck(RemoteFileConsumer.java:57)
	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(Executors.java:471)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: com.jcraft.jsch.JSchException: java.net.UnknownHostException:
abcd
	at com.jcraft.jsch.Util.createSocket(Util.java:389)
	at com.jcraft.jsch.Session.connect(Session.java:194)
	at
org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:115)

But am not getting these exceptions while using 

consumer.receive(""sftp://root@abcd:22//home/sample/?password=pwsd1&maximumReconnectAttempts=0&stepwise=false&fileName=sample.txt&throwExceptionOnConnectFailed=true&move=${file:name}.done");

inside my processor.





--
View this message in context: http://camel.465427.n5.nabble.com/Exception-not-thrown-while-doing-sftp-inside-consumer-receive-tp5749793.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Exception not thrown while doing sftp inside consumer.receive

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah I logged a ticket to improve this, which also explains a bit why
https://issues.apache.org/jira/browse/CAMEL-7345

On Fri, Apr 4, 2014 at 1:48 PM, geetha <ha...@gmail.com> wrote:
> Hi,
>
> If i use sftp inside from uri, am getting exceptions like this
>
> *For invalid username *-
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> connect to sftp://abcd@localhost: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.prePollCheck(RemoteFileConsumer.java:57)
>         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(Executors.java:471)
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:744)
> Caused by: com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 2 Too many
> authentication failures for abcd
>         at com.jcraft.jsch.Session.read(Session.java:938)
>         at com.jcraft.jsch.UserAuthPassword.start(UserAuthPassword.java:91)
>         at com.jcraft.jsch.Session.connect(Session.java:442)
>         at
> org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:115)
>
> *For invalid hostname* -
>
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> connect to sftp://root@abcd: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.prePollCheck(RemoteFileConsumer.java:57)
>         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(Executors.java:471)
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:744)
> Caused by: com.jcraft.jsch.JSchException: java.net.UnknownHostException:
> abcd
>         at com.jcraft.jsch.Util.createSocket(Util.java:389)
>         at com.jcraft.jsch.Session.connect(Session.java:194)
>         at
> org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:115)
>
> But am not getting these exceptions while using
>
> consumer.receive(""sftp://root@abcd:22//home/sample/?password=pwsd1&maximumReconnectAttempts=0&stepwise=false&fileName=sample.txt&throwExceptionOnConnectFailed=true&move=${file:name}.done");
>
> inside my processor.
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Exception-not-thrown-while-doing-sftp-inside-consumer-receive-tp5749793.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io