Integration Technologies - JDE1 (MOSC)

MOSC Banner

Groovy error when connecting to SFTP server

We encountered Groovy error when connecting to SFTP server.

The error says "InvokerInvocationException com.jcraft.jsch.JSchException: Algorithm negotiation fail"

Can someone shed lights on the solution?

How to reproduce: We created a Custom Request, and added some Groovy coding.


Example:

import com.jcraft.jsch.*

//

java.util.Properties config = new java.util.Properties()

config.put("StrictHostKeyChecking", "no")


JSch ssh = new JSch()


Session sess = ssh.getSession(strUserName, strHostName, iPort)

sess.setConfig(config)


sess.with{

setPassword strPassword

connect()

Channel chan = openChannel "sftp"

chan.connect()

ChannelSftp sftp = (ChannelSftp) chan;

sftp.cd(strSourceFilePath)


sftp.put(strNewFilePathName, strSourceFileName)


chan.disconnect()

disconnect()

}

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center