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

Re: [Subclipse-users] JAR+JSP+DLL

From: Mark Phippard <markphip_at_gmail.com>
Date: Tue, 16 Mar 2010 09:00:07 -0400

You cannot put the DLL's in the JAR, and please do not put them in
system32 as that is bad practice. They just need to live on the PATH.
 It might be conceivable that your application server does something
to put a path from your WAR on the PATH like Eclipse does with
plugins. If that is the case, you might be able to distribute your
DLL's in your WAR in some location that is unpacked like the classes
folder.

I would recommend you just install the CollabNet SVN client installer
for Windows since it will install JavaHL and all supporting DLL's and
add the folder to the PATH. They you do not need to distribute
anything special for the server except the Java code.

Now, in terms of your code and why it does not work I can see one
problem. You never registered the JavaHL adapter (or any adapter) so
none will be available. Take a look at the sample code provided:

http://subclipse.tigris.org/source/browse/subclipse/trunk/svnClientAdapter/src/samples/org/tigris/subversion/svnclientadapter/samples/Sample.java?revision=3041&view=markup

Specifically, you need to run a method something like this before you
do anything else. This registers the adapters you want to have
available:

public void setup() {
        try {
            JhlClientAdapterFactory.setup();
        } catch (SVNClientException e) {
            // can't register this factory
        }

   // Repeat for other adapters like CmdLine or SVNKit

    }

Once this code is run, provided that the DLL's are properly available,
the rest of your code ought to work.

On Tue, Mar 16, 2010 at 1:03 AM, Dilum Vithana <dilumdcv_at_gmail.com> wrote:
> Hi
> I'm using SVNClientAdapter to develope a web application. I created
> SVNClientAdapter.jar and put all the DLL files into the jar. My goal is to
> invoke a method in the SVNClientAdapter.jar thru jsp file. The jar is
> located in the "lib" folder of a web application (svnjavahl.jar is also
> located in the lib folder). The SVNClientAdapter java project is runing ok
> being called thru the Eclipse.
> In my project, I used following method.
>
> String bestClientType = SVNClientAdapterFactory.getPreferredSVNClientType();
>
> ISVNClientAdapter svnClient =
> SVNClientAdapterFactory.createSVNClient(bestClientType);
>
> svnClient.setUsername(username);
> svnClient.setPassword(password);
> NotifyListener listener = new Sample.NotifyListener();
> svnClient.addNotifyListener(listener);
>
> try {
>             svnClient.checkout(new SVNUrl(svnLocation),new
> File(destinationFolder),SVNRevision.HEAD,true);
>
>         } catch (IOException e) {
>             System.out.println("An exception occured while getting remote
> file :"+e.getMessage());
>         } catch (SVNClientException e) {
>             System.out.println("An exception occured while getting remote
> file :"+e.getMessage());
>         }
>
> The problem occures when the jsp call a method in the jar file,
> If i called jar file thru jsp, the value of the ISVNClientAdapter svnClient
> is null.
>
> I put all DLL files to C:\WINDOWS\system32 and try to solve it. But it is
> doesn't work
>
> Thanks for any advice.
>

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
------------------------------------------------------
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2460518
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subclipse.tigris.org].
Received on 2010-03-16 14:00:18 CET

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

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