SVNkit 无法创建 SVNRepoitory

2022-09-04 19:29:54

我正在尝试使用SVNkit在两个svn网址上运行差异。问题是我在调用时收到错误。diff.doDiff

org.tmatesoft.svn.core.SVNException: svn: Unable to create SVNRepository object for 'http://svn.codehaus.org/jruby/trunk/jruby/src/org/jruby/Finalizable.java' at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:55) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:40) at org.tmatesoft.svn.core.io.SVNRepositoryFactory.create(SVNRepositoryFactory.java:199) atorg.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool.createRepository(DefaultSVNRepositoryPool.java:213) at org.tmatesoft.svn.core.wc.SVNClientManager.createRepository(SVNClientManager.java:242) at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:231) at org.tmatesoft.svn.core.wc.SVNDiffClient.doDiffURLURL(SVNDiffClient.java:769) at org.tmatesoft.svn.core.wc.SVNDiffClient.doDiff(SVNDiffClient.java:310) at SVNTest.main(SVNTest.java:30)

我已经仔细检查了URL(我可以在TortoiseSVN客户端中打开它们)。任何人都可以帮助我知道发生了什么吗?我已经在下面发布了我正在运行的代码。

SVNClientManager manager = SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(false), user, pass);

SVNDiffClient diff = manager.getDiffClient();
    //ISVNDiffStatusHandler diffStatus = new ISVNDiffStatusHandler();

try {
SVNURL oldURL = SVNURL.parseURIDecoded(url);    
diff.doDiff(SVNURL.parseURIDecoded(url), SVNRevision.create(oldVersion), SVNURL.parseURIDecoded(url), SVNRevision.HEAD, false, false, System.out);
} catch (SVNException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

答案 1

你叫了下面的静态方法吗?

DAVRepositoryFactory.setup();

这需要在访问任何存储库和类似存储库之前调用http://

SVNRepositoryFactoryImpl.setup();

应用于存储库。svn://


答案 2

推荐