[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: Alexander Kitaev <Alexander.Kitaev_at_svnkit.com>
Date: 2007-03-26 19:14:45 CEST

Hello,

> 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
There is a caching of credentials. Both SVNKit and JavaHL uses default
credentials cache storage at ~/.subversion/auth
(%APPDATA%/Subversion/auth on Windows).

> bug? I think no authentication should be needed for operations on
> file:/// repositories.
Subversion needs user name to be provided for commit operation, even
when it is performed over "file" protocol. When no user name is
specified, default system one should be used. I think SVNKit was
throwing an exception when no user name was provided instead of using
default one.

You may fix it by using SVNClient.setPrompt(...) and returning user name
when asked or try latest version of SVNKit from "trunk" - most probably
it will resolve the problem. If not, please let me know.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

Shawn Jin 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.
>
> Thanks!
>
> Shawn
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: dev-help@subclipse.tigris.org
Received on Mon Mar 26 19:15:16 2007

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.