Question

I have used SSHJ to connect to a remote machine and that works fine when doing it from IntelliJIDEA. However when I try to build an "uberjar" using maven-shade-plugin I get the stacktrace shown below.

I do have org.bouncycastle.bcprov-jdk16 in the shade jar, and my program explicitly adds that as a provider: Security.addProvider(new BouncyCastleProvider());

I have tried to sign the jar according to the answer provided here: SSHJ and the Maven shade plugin Testing with 'maven-jarsigner-plugin' and 'maven-gpg-plugin' but with no luck.

Any help is much appreciated! Thanks!


net.schmizz.sshj.transport.TransportException: Unable to reach a settlement: [] and [aes128-ctr, aes192-ctr, aes256-ctr, arcfour256, arcfour128, aes128-cbc, 3des-cbc, blowfish-cbc, cast128-cbc, aes192-cbc, aes256-cbc, arcfour, rijndael-cbc@lysator.liu.se]
at net.schmizz.sshj.transport.Proposal.firstMatch(Proposal.java:165) ~[integration-tests-1.0-SNAPSHOT.jar:na]
at net.schmizz.sshj.transport.Proposal.negotiate(Proposal.java:147) ~[integration-tests-1.0-SNAPSHOT.jar:na]
at net.schmizz.sshj.transport.KeyExchanger.gotKexInit(KeyExchanger.java:239) ~[integration-tests-1.0-SNAPSHOT.jar:na]
at net.schmizz.sshj.transport.KeyExchanger.handle(KeyExchanger.java:364) ~[integration-tests-1.0-SNAPSHOT.jar:na]
at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:478) ~[integration-tests-1.0-SNAPSHOT.jar:na]
at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:127) ~[integration-tests-1.0-SNAPSHOT.jar:na]
at net.schmizz.sshj.transport.Decoder.received(Decoder.java:195) ~[integration-tests-1.0-SNAPSHOT.jar:na]
at net.schmizz.sshj.transport.Reader.run(Reader.java:72) ~[integration-tests-1.0-SNAPSHOT.jar:na]
Was it helpful?

Solution

I finally gave up on trying to put everything in a big "uberjar".

Instead I assembled all the jars using maven-assembly-plugin, and then extract and add them to the classpath in order to execute, e.g. 'java -cp all-needed-libs/* com.company.MainClass'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top