You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by sujata <su...@db.com> on 2017/06/27 06:08:13 UTC

Unable to connect to SFTP via private key

Hi Team,

We are trying to connect to SFTP using private key which we have generated
by PUTTYgen. We are able to connect via Winscp as well as file system(If we
store the private key into particular location).
But we are unable to connect  to SFTP when we are storing that key into
database.

We are getting below exception-




Caused by:
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
connect to sftp://******@********:22
                at
org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:143)
                at
org.apache.camel.component.file.remote.RemoteFileProducer.connectIfNecessary(RemoteFileProducer.java:202)
                at
org.apache.camel.component.file.remote.RemoteFileProducer.recoverableConnectIfNecessary(RemoteFileProducer.java:194)
                at
org.apache.camel.component.file.remote.RemoteFileProducer.preWriteCheck(RemoteFileProducer.java:126)
                at
org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:113)
                at
org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:56)
                at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
                at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
                at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
                at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
                at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:375)
                at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:343)
                at
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
                at
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:343)
                at
org.apache.camel.impl.ProducerCache.send(ProducerCache.java:184)
                at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:124)
                at
org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:163)
                ... 35 more
Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [B@1a126738
                at com.jcraft.jsch.KeyPair.load(KeyPair.java:732)
                at
com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:45)
                at com.jcraft.jsch.JSch.addIdentity(JSch.java:428)
                at
org.apache.camel.component.file.remote.SftpOperations.createSession(SftpOperations.java:197)
                at
org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:112)
                ... 51 more




Your help is appreciated.





--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-connect-to-SFTP-via-private-key-tp5805226.html
Sent from the Camel Development mailing list archive at Nabble.com.