diff --git a/src/main/java/net/schmizz/sshj/DefaultConfig.java b/src/main/java/net/schmizz/sshj/DefaultConfig.java index 03fd2cab..b9cd651c 100644 --- a/src/main/java/net/schmizz/sshj/DefaultConfig.java +++ b/src/main/java/net/schmizz/sshj/DefaultConfig.java @@ -85,7 +85,7 @@ public class DefaultConfig private String readVersionFromProperties() { try { Properties properties = new Properties(); - properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("sshj.properties")); + properties.load(DefaultConfig.class.getClassLoader().getResourceAsStream("sshj.properties")); String property = properties.getProperty("sshj.version"); return "SSHJ_" + property.replace('-', '_'); // '-' is a disallowed character, see RFC-4253#section-4.2 } catch (IOException e) { diff --git a/src/main/java/net/schmizz/sshj/common/SSHRuntimeException.java b/src/main/java/net/schmizz/sshj/common/SSHRuntimeException.java index 022adcd8..b9afd48f 100644 --- a/src/main/java/net/schmizz/sshj/common/SSHRuntimeException.java +++ b/src/main/java/net/schmizz/sshj/common/SSHRuntimeException.java @@ -34,7 +34,7 @@ public class SSHRuntimeException } public SSHRuntimeException(Throwable cause) { - this(null, cause); + this(cause.getMessage(), cause); } }