RE: Exception

View: New views
2 Messages — Rating Filter:   Alert me  

RE: Exception

by Zsolt Koppany :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alexander,

can you tell anything to it?

Zsolt

> -----Original Message-----
> From: Zsolt Koppany [mailto:zkoppanylist@...]
> Sent: Tuesday, September 25, 2007 10:10 AM
> To: javasvn-users@...
> Subject: RE: Exception
>
> Alexander,
>
> no I didn't.
>
> The exception was thrown by a junit test where we just create a local
> repository with File.createTempFile(...).
>
> We tried to understand the problem and our impression was that the length
> of
> the filename (without directory) caused the exception. If we used a
> shorter
> name we didn't get any exceptions. First I didn't believe that (the
> problem
> was reported by a college) but after playing with the file name I could
> reproduce the problem.
>
> Zsolt
>
> > -----Original Message-----
> > From: Alexander Kitaev [mailto:Alexander.Kitaev@...]
> > Sent: Monday, September 24, 2007 6:43 PM
> > To: javasvn-users@...
> > Subject: Re: Exception
> >
> > Hello Zsolt,
> >
> >  > I get the stack-trace below of the name of the top directory is
> >  > "cbrepository507" but it DOES work with the name "cbreposito507".
> >  >
> >  > Any ideas?
> >  > svn: Unable to open repository
> >  > 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
> > Did you try to use full path to repository in URL? I mean one without ~
> > in it - I think you can get SVNURL by calling
> > SVNURL.fromFile(file.getCanonicalFile()).
> >
> > Alexander Kitaev,
> > TMate Software,
> > http://svnkit.com/ - Java [Sub]Versioning Library!
> >
> > Zsolt Koppany wrote:
> > > Hi,
> > >
> > > I get the stack-trace below of the name of the top directory is
> > > "cbrepository507" but it DOES work with the name "cbreposito507".
> > >
> > > Any ideas?
> > >
> > > I use svnkit-1.1.4.
> > >
> > > Zsolt
> > >
> > > org.tmatesoft.svn.core.SVNException: svn: Unable to open an ra_local
> > session
> > > to URL
> > > svn: Unable to open repository
> > > 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
> > > svn: Unable to open repository
> > > 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
> > > at
> > >
> >
> org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.j
> > av
> > > a:49)
> > > at
> > >
> >
> org.tmatesoft.svn.core.internal.io.fs.FSRepository.openRepository(FSReposi
> > to
> > > ry.java:94)
> > > at
> > >
> >
> org.tmatesoft.svn.core.internal.io.fs.FSRepository.testConnection(FSReposi
> > to
> > > ry.java:82)
> > > at
> > >
> >
> org.tmatesoft.svn.core.io.SVNRepository.getRepositoryRoot(SVNRepository.ja
> > va
> > > :292)
> > > at
> > >
> >
> org.tmatesoft.svn.core.wc.SVNUpdateClient.validateRelocateTargetURL(SVNUpd
> > at
> > > eClient.java:1039)
> > > at
> > >
> >
> org.tmatesoft.svn.core.wc.SVNUpdateClient.relocateEntry(SVNUpdateClient.ja
> > va
> > > :1073)
> > > at
> > >
> >
> org.tmatesoft.svn.core.wc.SVNUpdateClient.doRelocate(SVNUpdateClient.java:
> > 11
> > > 05)
> > > at
> > >
> >
> org.tmatesoft.svn.core.wc.SVNUpdateClient.doRelocate(SVNUpdateClient.java:
> > 71
> > > 8)
> > > at
> > >
> >
> com.intland.codebeamer.scm.provider.svn.SvnJavaScmProvider.relocate(SvnJav
> > aS
> > > cmProvider.java:716)
> > > at
> > >
> >
> com.intland.codebeamer.scm.test.AbstractScmLoadImportRelocateTests.testRel
> > oc
> > > ate(AbstractScmLoadImportRelocateTests.java:267)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> > 39
> > > )
> > > at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> > pl
> > > .java:25)
> > > at java.lang.reflect.Method.invoke(Method.java:585)
> > > at junit.framework.TestCase.runTest(TestCase.java:154)
> > > at junit.framework.TestCase.runBare(TestCase.java:127)
> > > at
> > >
> >
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.j
> > av
> > > a:69)
> > > at junit.framework.TestResult$1.protect(TestResult.java:106)
> > > at junit.framework.TestResult.runProtected(TestResult.java:124)
> > > at junit.framework.TestResult.run(TestResult.java:109)
> > > at junit.framework.TestCase.run(TestCase.java:118)
> > > at junit.framework.TestSuite.runTest(TestSuite.java:208)
> > > at junit.framework.TestSuite.run(TestSuite.java:203)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit
> > 3T
> > > estReference.java:130)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java
> > :3
> > > 8)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTest
> > Ru
> > > nner.java:460)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTest
> > Ru
> > > nner.java:673)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunne
> > r.
> > > java:386)
> > > at
> > >
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunn
> > er
> > > .java:196)
> > > Caused by: org.tmatesoft.svn.core.SVNException: svn: Unable to open an
> > > ra_local session to URL
> > > svn: Unable to open repository
> > > 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
> > > svn: Unable to open repository
> > > 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
> > > ... 29 more
> > >
> > >
> > > Zsolt
> > >
> > >
> > >


Parent Message unknown Re: Exception

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Zsolt,

 >> We tried to understand the problem and our impression was that the
length
 >> of
 >> the filename (without directory) caused the exception. If we used a
 >> shorter
 >> name we didn't get any exceptions. First I didn't believe that (the
 >> problem
 >> was reported by a college) but after playing with the file name I could
 >> reproduce the problem.
This could be the reason - there is a limitation on Windows for file
path - its length shouldn't exceed 260 characters. This limitation could
be worked around by prepedning "\\?\" to the file path, but only when
done inside JVM native code, so we could do nothing about it.

There is a bug at
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4403166 and it is
marked as closed, but from user comments it doesn't look like it is
actually fixed even in the latest version of JDK.

However, taking in account path you've sent -
"C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507", even with ~ expanded its
length shouldn't exceed path length limit. That is why I was suspecting
that the reason of the problem are "~" characters. SVNURL.fromFile(new
File(file.getCanonicalPath())) should expand them.

I tried to perform some tests with that (creating repository in windows
temp directory (File.createTempFile() using both "shortened" and full
path). For me both versions worked fine (Windows XP, SP2, JDK 1.4 and 1.6):

absolute: C:\DOCUME~1\ALEXAN~1.KIT\LOCALS~1\Temp\cbrepository8521
url: file:///C:/DOCUME~1/ALEXAN~1.KIT/LOCALS~1/Temp/cbrepository8521
uuid: 1b3dec6b-1501-0010-adb1-95a35d681201

canonical: C:\Documents and Settings\Alexander.Kitaev\Local
Settings\Temp\cbrepository8521
url:
file:///C:/Documents%20and%20Settings/Alexander.Kitaev/Local%20Settings/Temp/cbrepository8521
uuid: 1b3dec6b-1501-0010-adb1-95a35d6812

Test code:

FSRepositoryFactory.setup();
               
File tmp = File.createTempFile("cbrepository", "");
SVNFileUtil.deleteAll(tmp, true);
System.out.println("absolute: " + tmp.getAbsolutePath());
SVNRepositoryFactory.createLocalRepository(tmp, false, false);

try {
  SVNURL url = SVNURL.fromFile(tmp);
  SVNRepository repos = SVNRepositoryFactory.create(url);
  repos.testConnection();
  System.out.println("url: " + url);
  System.out.println("uuid: " + repos.getRepositoryUUID(false));
} catch (SVNException e) {
  System.out.println("error: " + e.getMessage());
}

tmp = new File(tmp.getCanonicalPath());
System.out.println("canonical: " + tmp);

try {
  SVNURL url = SVNURL.fromFile(tmp);
  System.out.println("url: " + url);
  SVNRepository repos = SVNRepositoryFactory.create(url);
  repos.testConnection();
  System.out.println("uuid: " + repos.getRepositoryUUID(false));
} catch (SVNException e) {
  System.out.println("error: " + e.getMessage());
}

SVNFileUtil.deleteAll(tmp, true);
System.exit(0);

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

Zsolt Koppany wrote:

> Alexander,
>
> can you tell anything to it?
>
> Zsolt
>
>> -----Original Message-----
>> From: Zsolt Koppany [mailto:zkoppanylist@...]
>> Sent: Tuesday, September 25, 2007 10:10 AM
>> To: javasvn-users@...
>> Subject: RE: Exception
>>
>> Alexander,
>>
>> no I didn't.
>>
>> The exception was thrown by a junit test where we just create a local
>> repository with File.createTempFile(...).
>>
>> We tried to understand the problem and our impression was that the length
>> of
>> the filename (without directory) caused the exception. If we used a
>> shorter
>> name we didn't get any exceptions. First I didn't believe that (the
>> problem
>> was reported by a college) but after playing with the file name I could
>> reproduce the problem.
>>
>> Zsolt
>>
>>> -----Original Message-----
>>> From: Alexander Kitaev [mailto:Alexander.Kitaev@...]
>>> Sent: Monday, September 24, 2007 6:43 PM
>>> To: javasvn-users@...
>>> Subject: Re: Exception
>>>
>>> Hello Zsolt,
>>>
>>>  > I get the stack-trace below of the name of the top directory is
>>>  > "cbrepository507" but it DOES work with the name "cbreposito507".
>>>  >
>>>  > Any ideas?
>>>  > svn: Unable to open repository
>>>  > 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
>>> Did you try to use full path to repository in URL? I mean one without ~
>>> in it - I think you can get SVNURL by calling
>>> SVNURL.fromFile(file.getCanonicalFile()).
>>>
>>> Alexander Kitaev,
>>> TMate Software,
>>> http://svnkit.com/ - Java [Sub]Versioning Library!
>>>
>>> Zsolt Koppany wrote:
>>>> Hi,
>>>>
>>>> I get the stack-trace below of the name of the top directory is
>>>> "cbrepository507" but it DOES work with the name "cbreposito507".
>>>>
>>>> Any ideas?
>>>>
>>>> I use svnkit-1.1.4.
>>>>
>>>> Zsolt
>>>>
>>>> org.tmatesoft.svn.core.SVNException: svn: Unable to open an ra_local
>>> session
>>>> to URL
>>>> svn: Unable to open repository
>>>> 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
>>>> svn: Unable to open repository
>>>> 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
>>>> at
>>>>
>> org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.j
>>> av
>>>> a:49)
>>>> at
>>>>
>> org.tmatesoft.svn.core.internal.io.fs.FSRepository.openRepository(FSReposi
>>> to
>>>> ry.java:94)
>>>> at
>>>>
>> org.tmatesoft.svn.core.internal.io.fs.FSRepository.testConnection(FSReposi
>>> to
>>>> ry.java:82)
>>>> at
>>>>
>> org.tmatesoft.svn.core.io.SVNRepository.getRepositoryRoot(SVNRepository.ja
>>> va
>>>> :292)
>>>> at
>>>>
>> org.tmatesoft.svn.core.wc.SVNUpdateClient.validateRelocateTargetURL(SVNUpd
>>> at
>>>> eClient.java:1039)
>>>> at
>>>>
>> org.tmatesoft.svn.core.wc.SVNUpdateClient.relocateEntry(SVNUpdateClient.ja
>>> va
>>>> :1073)
>>>> at
>>>>
>> org.tmatesoft.svn.core.wc.SVNUpdateClient.doRelocate(SVNUpdateClient.java:
>>> 11
>>>> 05)
>>>> at
>>>>
>> org.tmatesoft.svn.core.wc.SVNUpdateClient.doRelocate(SVNUpdateClient.java:
>>> 71
>>>> 8)
>>>> at
>>>>
>> com.intland.codebeamer.scm.provider.svn.SvnJavaScmProvider.relocate(SvnJav
>>> aS
>>>> cmProvider.java:716)
>>>> at
>>>>
>> com.intland.codebeamer.scm.test.AbstractScmLoadImportRelocateTests.testRel
>>> oc
>>>> ate(AbstractScmLoadImportRelocateTests.java:267)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>>> 39
>>>> )
>>>> at
>>>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
>>> pl
>>>> .java:25)
>>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>>> at
>>>>
>> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.j
>>> av
>>>> a:69)
>>>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>> at junit.framework.TestResult.run(TestResult.java:109)
>>>> at junit.framework.TestCase.run(TestCase.java:118)
>>>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>>> at
>>>>
>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit
>>> 3T
>>>> estReference.java:130)
>>>> at
>>>>
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java
>>> :3
>>>> 8)
>>>> at
>>>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTest
>>> Ru
>>>> nner.java:460)
>>>> at
>>>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTest
>>> Ru
>>>> nner.java:673)
>>>> at
>>>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunne
>>> r.
>>>> java:386)
>>>> at
>>>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunn
>>> er
>>>> .java:196)
>>>> Caused by: org.tmatesoft.svn.core.SVNException: svn: Unable to open an
>>>> ra_local session to URL
>>>> svn: Unable to open repository
>>>> 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
>>>> svn: Unable to open repository
>>>> 'file:///C:/DOKUME~1/zk/LOKALE~1/Temp/cbrepository507'
>>>> ... 29 more
>>>>
>>>>
>>>> Zsolt
>>>>
>>>>
>>>>
>
>