IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

com.jcraft.jsch.JSchException: invalid server's version string

  • 1.  com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 10:37 AM

    We have a scheduler service which will run for every three minutes. The service will login to the SFTP server and get the files from the server. While connecting to the SFTP server we are receiving intermittent errors. The following is the error

    com.jcraft.jsch.JSchException: invalid server’s version string

    Note: We have tried replacing the jar file jsch-0.1.31.jar file with the latest jsch-0.1.51.jar but, in both the scenarios we are receiving the same exception. The SFTP server version string is SSH-2.0-OpenSSH_5.3

    May I know if anyone had this issue and what might be the reason? :roll:


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 2.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 11:46 AM

    Are you using the correct port. Did you restart the IS after placing the jars.


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 12:06 PM

    We are able to connect to the SFTP server. The error we are receiving is an intermittent error.


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 4.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 01:15 PM

    If it is intermittant then possible may be a bug or related to jars version etc…

    HTH,
    RMG


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 5.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 01:40 PM

    Yep! It is a bug in the JSch SFTP implementation and is already fixed in the version 0.1.20.

    http://www.jcraft.com/jsch/ChangeLog

    Though IS is using the 0.1.31 version we still have the issue, we have tried with the latest jar file which is 0.1.51 but it does not help. Just wanted to know if anyone had a similar issue.


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 6.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 01:43 PM

    jsch is open source, you can check the logic behind this error.

    I think the error is generated by
    com.jcraft.jsch.Session

    for my version (0.1.42), it has:
    if(i==buf.buffer.length ||
    i<7 || // SSH-1.99 or SSH-2.0
    (buf.buffer[4]==‘1’ && buf.buffer[6]!=‘9’) // SSH-1.5
    ){
    throw new JSchException(“invalid server’s version string”);
    }
    break;
    Does the server you are connecting has more than one instances? Since it’s intermittent, my guess is that one of the instance is running a version of SSH that is not supported by jsch.


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 01:53 PM

    Our server version string is SSH-2.0-OpenSSH_5.3

    But how can we know the server we are connecting has more than one instances?

    Thanks,
    Ramakrishna


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 8.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 02:03 PM

    check whoever runs the server.
    you can also enable logging, so you will see what’s the server version string is returned when it’s throwing that error. Check with jsch documentation for how to do logging.


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 9.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Wed October 08, 2014 02:36 PM

    Unfortunately, logging will not reveal the server version string that caused Session to throw the exception. The code that logs the version string comes immediately AFTER the code quoted in your post AFTER the exception is already thrown! Only well-formed version strings get logged. Sheesh.

    It should be relatively easy to modify Session to log the version string as soon as it’s returned. Then, with logging enabled, the next time the error occurs you’ll be able to see the version string that caused it.


    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 10.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Thu October 09, 2014 06:21 PM

    Great point, Perry!
    Jsch is easy to modify & recompile, you can easily do it.
    they should include this logging change in their core code base too, so you may also want to open a ticket with them.


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: com.jcraft.jsch.JSchException: invalid server's version string

    Posted Thu October 09, 2014 07:21 PM