Project

General

Profile

Problem with keys, when using SSH adaptor with JSAGA

Added by Singh Lokendra over 14 years ago

Hi all,

I am using SSH adaptor with JSAGA.The following error is generating when running the program. Seems some problem with keys. I am basically running the executable /bin/date on my localhost itself ie. serverNode= ssh://localhost#SSH.

Error:
Caught: java.lang.ClassCastException: com.sun.crypto.provider.DHKeyAgreement cannot be cast to javax.crypto.KeyAgreementSpi

java.lang.ClassCastException: com.sun.crypto.provider.DHKeyAgreement cannot be cast to javax.crypto.KeyAgreementSpi
    at javax.crypto.KeyAgreement.getInstance(Unknown Source)
    at com.jcraft.jsch.jce.DH.init(DH.java:51)

    at com.jcraft.jsch.DHG1.init(DHG1.java:107)
    at com.jcraft.jsch.Session.receive_kexinit(Session.java:522)
    at com.jcraft.jsch.Session.connect(Session.java:283)
    at com.jcraft.jsch.Session.connect(Session.java:149)

    at fr.in2p3.jsaga.adaptor.ssh.SSHAdaptorAbstract.connect(SSHAdaptorAbstract.java:141)
    at fr.in2p3.jsaga.engine.factories.JobAdaptorFactory.getJobControlAdaptor(JobAdaptorFactory.java:120)
    at fr.in2p3.jsaga.impl.job.AbstractSyncJobFactoryImpl.doCreateJobServiceSync(AbstractSyncJobFactoryImpl.java:51)

    at fr.in2p3.jsaga.impl.job.JobFactoryImpl.doCreateJobService(JobFactoryImpl.java:35)
    at org.ogf.saga.job.JobFactory.createJobService(JobFactory.java:135)
    at org.ogf.saga.job.JobFactory$createJobService.call(Unknown Source)

Although, I have authorised localhost using the following commands

ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh localhost -i ~/.ssh/id_rsa

What could be source of error?


Replies (4)

RE: Problem with keys, when using SSH adaptor with JSAGA - Added by Reynaud Sylvain over 14 years ago

Hi Lokendra,

I have never seen this error message before, but maybe incompatible libraries could be the source of error...

Do you have security-related libraries that are not provided by JSAGA?
Which version of the JDK do you use?

RE: Problem with keys, when using SSH adaptor with JSAGA - Added by Singh Lokendra over 14 years ago

removing jce-jdk13-1.3.1.jar from the classpath worked.
jce-jdk13-1.3.1.jar had the javax.crypto.KeyAgreementSpi.class file, which was creating the problem, I think.

Lokendra

RE: Problem with keys, when using SSH adaptor with JSAGA - Added by Reynaud Sylvain over 14 years ago

Hi Lokendra,

Thanks for the workaround.

I can not find the conflicting "com.sun.crypto.provider.DHKeyAgreement" class neither in JSAGA libraries, nor in JDK 1.5 and 1.6 libraries. Do you know which library is providing it?

The "jce-jdk13-1.3.1.jar" library is used by plug-ins unicore6, naregi et cream (see http://grid.in2p3.fr/software/jsaga-dev/dependencies-graph.html).

So if you need to use SSH and one of these plug-ins from the same application, you will probably have to find another solution. For example, you could try to replace it with another version available on BouncyCastle web site (http://www.bouncycastle.org/latest_releases.html). If you do some tests with one of these jce versions, please post your feedback on this forum!

Sylvain

RE: Problem with keys, when using SSH adaptor with JSAGA - Added by Singh Lokendra over 14 years ago

Hi Sylvain,

Thanks for the information about using plugins with SSH adaptor.

I am Sorry for not being clear in my previous post. The "com.sun.crypto.provider.DHKeyAgreement" is provided in the "sunjce-provider.jar" which is a part of JRE (1.5/1.6) libraries (which, by mistake, was in my classpath)

Regards
Lokendra

    (1-4/4)