1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[skript-mirror] the method threw a NoClassDefFoundError

Discussion in 'Requests' started by Ghostfish_, Aug 12, 2020.

  1. Ghostfish_

    Ghostfish_ New Member

    Joined:
    May 6, 2020
    Messages:
    5
    Likes Received:
    0
    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!
     
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    Can you print the whole stack trace using (last exception).printStackTrace() after connect method?
    PS Next time, use the right section and code blocks.
     

Share This Page

Loading...