Can't Connect

Help
amardilo
2009-10-21
2013-05-20
  • amardilo
    amardilo
    2009-10-21

    Hi there,

    I am using SSHTools 0.2.9 (running on Java 2 SDK 1.4.1). But I can connect to any SSH servers (I can however connect to those servers via PuTTY and WinSCP and other SSH clients).

    The code falls over on the connect.

        sshClient = new SshClient();
        sshClient.connect(someIPAddress);

    The output I see on my web browser is:

    > root cause
    >
    > java.lang.NoClassDefFoundError:
    > java/util/concurrent/ConcurrentHashMap
    > at
    > com.sshtools.j2ssh.connection.ConnectionProtocol.(Unknown
    > Source) at
    > com.sshtools.j2ssh.SshClient.connect(Unknown
    > Source) at
    > com.sshtools.j2ssh.SshClient.connect(Unknown
    > Source) at
    > com.sshtools.j2ssh.SshClient.connect(Unknown
    > Source) at
    > javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    > at
    > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    > at
    > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    > at
    > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
    > at
    > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    > at
    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    > at
    > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    > at
    > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    > at
    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    > at
    > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    > at
    > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    > at
    > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    > at
    > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    > at
    > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    > at
    > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    > at
    > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    > at
    > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
    > at
    > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    > at
    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    > at
    > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    > at
    > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    > at
    > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    > at
    > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    > at
    > org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
    > at
    > org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
    > at
    > java.lang.Thread.run(Thread.java:536)

    Also in my output browser the last few lines are:

    > 21-Oct-2009 17:47:28
    > com.sshtools.j2ssh.transport.TransportProtocolCommon
    > negotiateVersion INFO: Negotiating
    > protocol version 21-Oct-2009 17:47:28
    > com.sshtools.j2ssh.transport.TransportProtocolCommon
    > negotiateVersion INFO: Protocol
    > negotiation complete 21-Oct-2009
    > 17:47:28
    > com.sshtools.j2ssh.transport.TransportProtocolCommon
    > beginKeyExchange INFO: Starting key
    > exchange 21-Oct-2009 17:47:28
    > com.sshtools.j2ssh.transport.kex.DhGroup1Sha1
    > performClientExchange INFO: Starting
    > client side key exchange. 21-Oct-2009
    > 17:47:29
    > com.sshtools.j2ssh.transport.AbstractKnownHostsKeyVerification
    > verifyHost INFO: Verifying
    > 10.100.100.251 host key 21-Oct-2009 17:47:29
    > com.sshtools.j2ssh.transport.TransportProtocolClient
    > verifyHostKey INFO: The host key
    > signature is  valid 21-Oct-2009
    > 17:47:29
    > com.sshtools.j2ssh.transport.TransportProtocolCommon
    > completeKeyExchange INFO: Completing
    > key exchange 21-Oct-2009 17:47:29
    > com.sshtools.j2ssh.transport.cipher.SshCipherFactory
    > newInstance INFO: Creating new
    > blowfish-cbc cipher instance
    > 21-Oct-2009 17:47:29
    > com.sshtools.j2ssh.transport.cipher.SshCipherFactory
    > newInstance INFO: Creating new
    > blowfish-cbc cipher instance

    Can anyone help?

     
  • Pat
    Pat
    2009-10-21

    java/util/concurrent/ConcurrentHashMap was added in Java 1.5.  So, you need to either switch to 1.5 or use an older version of j2ssh.

     
  • amardilo
    amardilo
    2009-10-21

    that's perfect thanks for that.

    Do you know which versions of SSHTools works with my version of Java?