[skript-mirror] the method threw a NoClassDefFoundError

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Ghostfish_

New Member
May 6, 2020
5
0
1
24
error message from skript:

[Skript] method SSHClient#connect called with (node01.39mc.top (String), 2022 (Long)) threw a NoClassDefFoundError: Could not initialize class net.schmizz.sshj.common.KeyType
[Skript] method SSHClient#authPassword called with (xxxxxxxxxx.xxxxxxx (String), xxxxxxxxxx (String)) threw a TransportException: Timeout expired
[Skript] method SSHClient#newSFTPClient called without arguments threw a IllegalStateException: Not authenticated

So I am trying to write an sftp connection skript to send certain files to my beegueCord server
base on this tutorial: https://www.baeldung.com/java-file-sftp

here is the code:

import:
java.io.File
java.io.FileInputStream
java.io.FileOutputStream
java.io.BufferedOutputStream
java.io.IOException
java.io.InputStream
java.io.OutputStream

net.schmizz.sshj.SSHClient
net.schmizz.sshj.SocketClient
net.schmizz.sshj.transport.verification.PromiscuousVerifier

function setUpSSHJ() :: object:
set {_client} to new SSHClient()
{_client}.addHostKeyVerifier(new PromiscuousVerifier())
{_client}.connect({BC.FTP::1}, {BC.FTP::2})
{_client}.authPassword({BC.FTP::3}, {BC.FTP::4})
return {_client}

function sftpUpload(player: player, localAdd: text, remoteAdd: text):
set {_sshjClient} to setUpSSHJ()
set {_sftpClient} to {_sshjClient}.newSFTPClient()
{_sftpClient}.put({_localAdd}, {_remoteAdd})
{_sftpClient}.close()
{_sshjClient}.disconnect()

command //TFAA:
trigger:
sftpUpload(player, "bcForwardingHub/test/theFirstAttemp.txt", "bcForwardingHub/test/theFirstAttemp.txt")

it threw a NoClassDefFoundError...

I need help here...
thank you very much!
 
error message from skript:

[Skript] method SSHClient#connect called with (node01.39mc.top (String), 2022 (Long)) threw a NoClassDefFoundError: Could not initialize class net.schmizz.sshj.common.KeyType
[Skript] method SSHClient#authPassword called with (xxxxxxxxxx.xxxxxxx (String), xxxxxxxxxx (String)) threw a TransportException: Timeout expired
[Skript] method SSHClient#newSFTPClient called without arguments threw a IllegalStateException: Not authenticated

So I am trying to write an sftp connection skript to send certain files to my beegueCord server
base on this tutorial: https://www.baeldung.com/java-file-sftp

here is the code:

import:
java.io.File
java.io.FileInputStream
java.io.FileOutputStream
java.io.BufferedOutputStream
java.io.IOException
java.io.InputStream
java.io.OutputStream

net.schmizz.sshj.SSHClient
net.schmizz.sshj.SocketClient
net.schmizz.sshj.transport.verification.PromiscuousVerifier

function setUpSSHJ() :: object:
set {_client} to new SSHClient()
{_client}.addHostKeyVerifier(new PromiscuousVerifier())
{_client}.connect({BC.FTP::1}, {BC.FTP::2})
{_client}.authPassword({BC.FTP::3}, {BC.FTP::4})
return {_client}

function sftpUpload(player: player, localAdd: text, remoteAdd: text):
set {_sshjClient} to setUpSSHJ()
set {_sftpClient} to {_sshjClient}.newSFTPClient()
{_sftpClient}.put({_localAdd}, {_remoteAdd})
{_sftpClient}.close()
{_sshjClient}.disconnect()

command //TFAA:
trigger:
sftpUpload(player, "bcForwardingHub/test/theFirstAttemp.txt", "bcForwardingHub/test/theFirstAttemp.txt")

it threw a NoClassDefFoundError...

I need help here...
thank you very much!
Can you print the whole stack trace using (last exception).printStackTrace() after connect method?
PS Next time, use the right section and code blocks.