svnkit Error:org.tmatesoft.svn.core.SVNException: svn: E175002: connection refused by the server
svnkit Error:org.tmatesoft.svn.core.SVNException: svn: E175002: connection refused by the server
我使用 svnkit 来检查 svn,我在服务器(Centos7.6)上得到这个错误:
svn: E175002: OPTIONS request failed on '/svn/***/***'
org.tmatesoft.svn.core.SVNException: svn: E175002: connection refused by the server
svn: E175002: OPTIONS request failed on '/svn/***/***'
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:112)
at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:178)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:43)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.checkout(SvnNgAbstractUpdate.java:831)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:26)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:11)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1239)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:777)
...
Caused by: java.net.ConnectException: 拒绝连接 (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:606)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.connect(SVNSocketFactory.java:164)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory._createSSLSocket(SVNSocketFactory.java:124)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createSSLSocket(SVNSocketFactory.java:94)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:237)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:415)
... 36 more
但是当我在我自己的系统 windows 10 上测试这个应用程序时,它工作得很好 well.I 可以检出,我可以提交等等没有错误。我可以找到问题所在,我知道是 svn 服务工作 fine.I 认为这可能是网络问题,但我不确定,因为 ping svn 服务器 IP 是 return OK。
帮我!
我的代码如下:
pom.xml:
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.9.3</version>
</dependency>
Java:
public long checkout(SVNClientManager clientManager, SVNURL url,
SVNRevision revision, File destPath, SVNDepth depth) {
SVNUpdateClient updateClient = clientManager.getUpdateClient();
/*
* sets externals not to be ignored during the checkout
*/
updateClient.setIgnoreExternals(false);
/*
* returns the number of the revision at which the working copy is
*/
try {
return updateClient.doCheckout(url, destPath, revision, revision, depth, false);
// return updateClient.doCheckout(url, destPath, revision, revision, depth, true);
} catch (SVNException e) {
logger.error(e.getMessage());
e.printStackTrace();
}
return 0;
}
我猜你应该用嗅探器(wireshark 或 tshark)检查流量是否in/out,在你的盒子上或在 svn 服务器上。
我使用 svnkit 来检查 svn,我在服务器(Centos7.6)上得到这个错误:
svn: E175002: OPTIONS request failed on '/svn/***/***'
org.tmatesoft.svn.core.SVNException: svn: E175002: connection refused by the server
svn: E175002: OPTIONS request failed on '/svn/***/***'
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:112)
at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:178)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:43)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.checkout(SvnNgAbstractUpdate.java:831)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:26)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:11)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1239)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:777)
...
Caused by: java.net.ConnectException: 拒绝连接 (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:606)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.connect(SVNSocketFactory.java:164)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory._createSSLSocket(SVNSocketFactory.java:124)
at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createSSLSocket(SVNSocketFactory.java:94)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:237)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:415)
... 36 more
但是当我在我自己的系统 windows 10 上测试这个应用程序时,它工作得很好 well.I 可以检出,我可以提交等等没有错误。我可以找到问题所在,我知道是 svn 服务工作 fine.I 认为这可能是网络问题,但我不确定,因为 ping svn 服务器 IP 是 return OK。
帮我!
我的代码如下:
pom.xml:
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.9.3</version>
</dependency>
Java:
public long checkout(SVNClientManager clientManager, SVNURL url,
SVNRevision revision, File destPath, SVNDepth depth) {
SVNUpdateClient updateClient = clientManager.getUpdateClient();
/*
* sets externals not to be ignored during the checkout
*/
updateClient.setIgnoreExternals(false);
/*
* returns the number of the revision at which the working copy is
*/
try {
return updateClient.doCheckout(url, destPath, revision, revision, depth, false);
// return updateClient.doCheckout(url, destPath, revision, revision, depth, true);
} catch (SVNException e) {
logger.error(e.getMessage());
e.printStackTrace();
}
return 0;
}
我猜你应该用嗅探器(wireshark 或 tshark)检查流量是否in/out,在你的盒子上或在 svn 服务器上。