Probably the result of a fix somewhere between 0.0.14 and 1.0.0.
At a guess, I would say that all the threads are now daemon threads, so
they won't stop a System.exit. This is what I would expect at least.
You could try putting a "Thread.wait()" after sshd.start(), so that the
main thread doesn't exit and see if the rest still works as you want it.
On 17/12/15 01:51, rockyfm wrote:
> I am using Apache Mina sshd-core-1.0.0 to start an SFTP daemon. The program
> however exits after the sshd.start(). There are no errors. However if I use
> sshd-core-0.0.14, the server starts just fine and I can initiate an sftp
> session. Am I missing something with 1.0.0 ?
>
> Code snippet with 1.0.0 (does not work)
> =========================
> public static void main(String[] args) throws IOException {
> SshServer sshd = SshServer.setUpDefaultServer();
> sshd.setPort(2222);
> sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(new File
> ("hostkey.ser")))
> sshd.setPasswordAuthenticator(new AuthenticatorImpl());
> sshd.start();
> }
>
> Code snippet with 0.0.14 (works)
> =====================
> public static void main(String[] args) throws IOException {
> SshServer sshd = SshServer.setUpDefaultServer();
> sshd.setPort(2222);
> sshd.setKeyPairProvider(new
> SimpleGeneratorHostKeyProvider("hostkey.ser"));
> sshd.setPasswordAuthenticator(new AuthenticatorImpl());
> sshd.start();
> }
>
>
>
>
> --
> View this message in context:
> http://apache-mina.10907.n7.nabble.com/Cannot-start-sshd-1-0-server-tp49119.html
> Sent from the Apache MINA User Forum mailing list archive at Nabble.com.