I am having sftp connection issues. I am using version 2.5. My route is similar to the code below. CamelContext camelContext = new DefaultCamelContext(); final Endpoint endpoint = camelContext.getEndpoint("seda:export"); final String dynaUri = "sftp://localhost:22/data?username=user&password=pass"; ProducerTemplate producerTemplate = camelContext.createProducerTemplate(); RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() throws Exception { this.from(endpoint).to(dynaUri); } }; camelContext.addRoutes(routeBuilder); camelContext.start(); byte[] buf = "Hello camel!".getBytes(); ByteArrayInputStream inputStream = new ByteArrayInputStream(buf); Exchange exchange = endpoint.createExchange(); exchange.getIn().setHeader(Exchange.FILE_NAME, "test.txt"); exchange.getIn().setBody(inputStream); producerTemplate.send(endpoint, exchange); camelContext.stop();
My junit tests run fine, but when I deploy to jboss (4.2.2), I get the below exception. Any advice would be appreciated... 2011-08-04 15:54:19,868|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> Connecting to localhost port 22 2011-08-04 15:54:19,871|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> Connection established 2011-08-04 15:54:19,872|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> Remote version string: SSH-2.0-WeOnlyDo 2.1.3 2011-08-04 15:54:19,872|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> Local version string: SSH-2.0-JSCH-0.1.44 2011-08-04 15:54:19,872|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256 2011-08-04 15:54:19,874|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> aes256-ctr is not available. 2011-08-04 15:54:19,874|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> aes192-ctr is not available. 2011-08-04 15:54:19,874|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> aes256-cbc is not available. 2011-08-04 15:54:19,875|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> aes192-cbc is not available. 2011-08-04 15:54:19,875|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> arcfour256 is not available. 2011-08-04 15:54:19,875|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> SSH_MSG_KEXINIT sent 2011-08-04 15:54:19,876|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> SSH_MSG_KEXINIT received 2011-08-04 15:54:19,877|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> kex: server->client aes128-cbc hmac-md5 none 2011-08-04 15:54:19,877|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> kex: client->server aes128-cbc hmac-md5 none 2011-08-04 15:54:19,883|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> SSH_MSG_KEXDH_INIT sent 2011-08-04 15:54:19,883|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> expecting SSH_MSG_KEXDH_REPLY 2011-08-04 15:54:19,914|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> ssh_rsa_verify: signature true 2011-08-04 15:54:19,914|Camel Thread 8 - seda://export|WARN |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> Permanently added 'localhost' (RSA) to the list of known hosts. 2011-08-04 15:54:19,914|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> SSH_MSG_NEWKEYS sent 2011-08-04 15:54:19,915|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> SSH_MSG_NEWKEYS received 2011-08-04 15:54:19,917|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> SSH_MSG_SERVICE_REQUEST sent 2011-08-04 15:54:19,918|Camel Thread 8 - seda://export|INFO |org.apache.camel.component.file.remote.SftpOperations|log|JSCH -> Disconnecting from localhost port 22 2011-08-04 15:54:19,918|Camel Thread 8 - seda://export|WARN |org.apache.camel.component.file.remote.RemoteFileProducer|handleFailedWrite|Writing file failed with: Cannot connect to sftp://user@localhost:22 2011-08-04 15:54:19,919|Camel Thread 8 - seda://export|DEBUG|org.apache.camel.processor.DefaultErrorHandler|log|Failed delivery for exchangeId: ID-STEVE-53658-1312490657533-3-3. On delivery attempt: 0 caught: org.apache.camel.component.file.GenericFileOperationFailedException: Cannot connect to sftp://user@localhost:22 2011-08-04 15:54:19,919|Camel Thread 8 - seda://export|ERROR|org.apache.camel.processor.DefaultErrorHandler|log|Failed delivery for exchangeId: ID-STEVE-53658-1312490657533-3-3. Exhausted after delivery attempt: 1 caught: org.apache.camel.component.file.GenericFileOperationFailedException: Cannot connect to sftp://user@localhost:22 org.apache.camel.component.file.GenericFileOperationFailedException: Cannot connect to sftp://user@localhost:22 at org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:113) at org.apache.camel.component.file.remote.RemoteFileProducer.connectIfNecessary(RemoteFileProducer.java:198) at org.apache.camel.component.file.remote.RemoteFileProducer.recoverableConnectIfNecessary(RemoteFileProducer.java:188) at org.apache.camel.component.file.remote.RemoteFileProducer.preWriteCheck(RemoteFileProducer.java:116) at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:88) at org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:49) at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208) at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:169) at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:111) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read at com.jcraft.jsch.Session.connect(Session.java:504) at org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:85) ... 33 more -- View this message in context: http://camel.465427.n5.nabble.com/SFTP-connection-issue-tp4668687p4668687.html Sent from the Camel - Users mailing list archive at Nabble.com.