java.lang.NoClassDefFoundError Using SVNKit Via SVN SSH

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Attempting to securely connect to an SVN repository (svn+ssh) using the built-in SVNKit leads to a NoClassDefFoundError:

java.lang.NoClassDefFoundError: com/trilead/ssh2/InteractiveCallback
        at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:88)
        at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:74)
        at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1242)
        at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:168)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:482)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:873)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:534)
        at org.tmatesoft.svn.core.wc.SVNWCClient.doInfo(SVNWCClient.java:2561)
        at org.tmatesoft.svn.cli.svn.SVNInfoCommand.run(SVNInfoCommand.java:102)
        at org.tmatesoft.svn.cli.AbstractSVNCommandEnvironment.run(AbstractSVNCommandEnvironment.java:134)
        at org.tmatesoft.svn.cli.AbstractSVNLauncher.run(AbstractSVNLauncher.java:81)
        at org.tmatesoft.svn.cli.svn.SVN.main(SVN.java:26)
        at org.tmatesoft.svn.cli.SVN.main(SVN.java:22)
Caused by: java.lang.ClassNotFoundException: com.trilead.ssh2.InteractiveCallback
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 13 more

 

Manually test the secure connection from the command line using the jsvn script located in FISHEYE_HOME/lib/svn:

C:\atlassian\fisheye\fisheye-2.7.14\fecru-2.7.14\lib\svn>jsvn info svn+ssh://localhost
SVNKIT_VER: 1.3.3.6708
Authentication realm: svn+ssh://localhost
Username: test
Password for 'localhost' (leave blank if you are going to use private key):
Port number for 'localhost' [22]:
java.lang.NoClassDefFoundError: com/trilead/ssh2/InteractiveCallback
        at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:88)
        at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:74)
        at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1242)
        at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:168)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:482)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:873)
        at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:534)
        at org.tmatesoft.svn.core.wc.SVNWCClient.doInfo(SVNWCClient.java:2561)
        at org.tmatesoft.svn.cli.svn.SVNInfoCommand.run(SVNInfoCommand.java:102)
        at org.tmatesoft.svn.cli.AbstractSVNCommandEnvironment.run(AbstractSVNCommandEnvironment.java:134)
        at org.tmatesoft.svn.cli.AbstractSVNLauncher.run(AbstractSVNLauncher.java:81)
        at org.tmatesoft.svn.cli.svn.SVN.main(SVN.java:26)
        at org.tmatesoft.svn.cli.SVN.main(SVN.java:22)
Caused by: java.lang.ClassNotFoundException: com.trilead.ssh2.InteractiveCallback
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 13 more

Cause

This is a known bug:

FE-3841 - Getting issue details... STATUS

Resolution

 The name of the trilead JAR file referenced in the SVNKIT_CLASSPATH variable in the jsvn script is incorrect. Modify the jsvn script to correctly reference "trilead-svnkit-1.3.3.6708" instead of "svnkit-trilead-1.3.3.6708". The correct variable should be:

set SVNKIT_CLASSPATH=%SVNKIT_HOME%svnkit-%SVNKIT_VER%.jar;%SVNKIT_HOME%svnkit-cli-%SVNKIT_VER%.jar;%SVNKIT_HOME%trilead-svnkit-%SVNKIT_VER%.jar;%SVNKIT_HOME%svnkit-jna-%SVNKIT_VER%.jar


Last modified on Nov 21, 2012

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.