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

Re: [Subclipse-dev] svnClientAdapter: Authentication cancelled when creating remote folder on file:/// repository

From: Mark Phippard <markphip_at_gmail.com>
Date: 2007-03-26 19:06:33 CEST

On 3/26/07, Shawn Jin <shawnemails@gmail.com> wrote:
>
> Hi all, I am attempting to implement a svn plugin using svnClientAdapter.
> I observed following problems when trying to create remote directories with
> SVNKit (1.1.1). Here is the codes:
>
> private void mkdir(){
> String reposPath = "/filerepos1";
> String clientType = SvnKitClientAdapterFactory.SVNKIT_CLIENT;
> svnClient = SVNClientAdapterFactory.createSVNClient(clientType);
> String fs = ISVNClientAdapter.REPOSITORY_FSTYPE_FSFS;
>
> //Creates file repo
> try {
> svnClient.createRepository(new File(reposPath), fs);
> } catch (SVNClientException svne) {
> svne.printStackTrace();
> }
>
> try {
> SVNUrl url;
> //Creates new dir "aa"
> url = new SVNUrl("file://" + reposPath + "/aa");
> svnClient.mkdir(url, "");
> }
> catch (SVNClientException e) {
> e.printStackTrace();
> }
> catch (MalformedURLException me) {
> me.printStackTrace();
> }
> }
>
> This will generate exception:
> org.tigris.subversion.svnclientadapter.SVNClientException:
> org.tigris.subversion.javahl.ClientException: svn: authentication
> cancelled
> at
> org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.mkdir(
> AbstractJhlClientAdapter.java:748)
> at mysvn.SVNMkdir.mkdir(SVNMkdir.java:91)
>
> I found if I add something like this before the code svnClient.mkdir(url,
> "");
> svnClient.setUsername("anything");
> svnClient.setPassword(" ");
> the directory will be created successfully. And even if I delete the above
> 2 lines of code, change "aa" to "bb", recompile, and re-run the program, it
> will do the job too! However I run the code in debug mode and see
> svnClient.myUserName and svnClient.myPassword are both null in the second
> case. How could that pass the authentication???
>
> I am new to subversion. I suspect that there is some caching going on with
> subversion authentications. Or is it something to do with the authentication
> mechanism of svnClientAdapter or svnKit? Could this be a bug? I think no
> authentication should be needed for operations on file:/// repositories.

You are correct that authentication should not be needed, but it would be
the SVNKit code that is throwing this exception. So maybe they like some
method to be called before doing these operations?

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
Received on Mon Mar 26 19:06:52 2007

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