[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Subclipse-dev] unavailable JavaSVN causes NoClassDefFoundError, commandline appends unnecessary commit message

From: iochroma <iochroma_at_yahoo.com>
Date: 2006-10-14 15:35:06 CEST

Hi there!

After spending hours and hours and hours bringing my ant build script to life I thought I should share my wisdom with you as I stumbled over some subclipse odds and ends.
I used the latest sources from trunk. The client adapter 0.9.23 nearly gave me the creeps (localized commandline parsing failed).
I have no idea if all this was said and done before. No time to search the mailing list intensively, sorry.
Additional regrets if I did anything else wrong, this is my first posting.

1) The javahl library will not be used in a nested ant script called by the <ant> task. This is due to an UnsatisfiedLinkError: Native Library ...lib....dll already loaded in another classloader
see the following articles:

This is an ant issue but it might be useful to find it in the FAQ.

2) using the commandline client a WC->WC copy failed since the commit message is always appended, the default is an empty string. A WC->WC does only not require it, my svn command (1.3.0) refuses it and throws an error (does 1.4 accept it anyway?). Maybe it is wise to only append a message if the user stated one. I did the following and modified src/main/org/tigris/subversion/svnclientadapter/commandline/CommandLine.java:
        if (message != null) {
                //add((message != null) ? message : "");

This is a quick-and-dirty solution that worked. I didn't care much about the "--force-log".

3) if no javasvn library is on the classpath the svn ant task fails with a NoClassDefFoundError. The JavaSvnClientAdapterFactory is called by setup() via svnant SvnTask and immediately instantiates the JavaSvnClientAdapter which depends on tmatesoft classes like org.tmatesoft.svn.core.SVNException. This causes the error.
Instead you should do an isAvailable() test like JhlClientAdapterFactory does. But beware, it must not be done in the Adapter class like javahl does.
    public static boolean isAvailable() {
        try {
            Class c = Class.forName("org.tmatesoft.svn.core.javahl.SVNClientImpl");
            return true;
        } catch (Throwable t) {
            return false;
     * Setup the client adapter implementation and register it in the adapters factory
     * @throws SVNClientException
    public static void setup() throws SVNClientException {
        if (!isAvailable()) {
            throw new SVNClientException("JavaSVN client adapter is not available");
        SVNClientAdapterFactory.registerAdapterFactory(new JavaSvnClientAdapterFactory());

I suggest moving the isAvailable() method of javahl to it's factory too, for reasons of uniformity.
By the way, the isAvailable() of javahl needs some rework with loops.

And I might be forgiven for not doing this modifications by myself. The deadline hangs over my like the Sword of Damocles.

To unsubscribe, e-mail: dev-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: dev-help@subclipse.tigris.org
Received on Sat Oct 14 15:38:13 2006

This is an archived mail posted to the Subclipse Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.