java.lang.NoClassDefFoundError Using SVNKit Via SVN SSH
Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
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 moreManually 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 moreCause
This is a known bug:
FE-3841 - jsvn tries to use svnkit-trilead-$SVNKIT_VER.jar instead of trilead-svnkit-$SVNKIT_VER.jar
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%.jarWas this helpful?