|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
VISTA SVN CONNECTION ISSUE svn: connection refused by the serverI've been stuck on an svn exception when attempting to to import a directory to a local url on the svn protocol and everytime I run the code I get A Subversion error has been caused due to : org.tmatesoft.svn.core.SVNException: svn: connection refused by the server
public class SubversionImport { private static String path; private static String url; private static String message; private static boolean recurse; private static CommitEventHandler commitHandler; private static SVNClientManager clientManager; public static void execute(){ setupLibrary(); try{ SVNURL svnurl = SVNURL.parseURIDecoded(url); ISVNOptions options = SVNWCUtil.createDefaultOptions(true); clientManager = SVNClientManager.newInstance(options); commitHandler = new CommitEventHandler(); clientManager.getUpdateClient().setEventHandler(commitHandler); File pathToImp = new File(path); if(pathToImp.exists() && pathToImp.isDirectory()) importDirectory(pathToImp, svnurl, message, recurse); else throw new IOException("Check that the directory to import exists"); }catch(IOException io){ System.out.println(io.getMessage()); }catch(SVNException svne){ System.out.println("A Subversion error has been caused due to : " + svne); svne.printStackTrace(); } } private static SVNCommitInfo importDirectory(File localPath,SVNURL dstURL,String commitMessage, boolean isRecursive)throws SVNException { return clientManager.getCommitClient( ).doImport( localPath , dstURL , commitMessage , isRecursive ); } public static String getPath() { return path; } public static void setPath(String path) { SubversionImport.path = path; } public static String getUrl() { return url; } public static void setUrl(String url) { SubversionImport.url = url; } public static String getMessage() { return message; } public static void setMessage(String message) { SubversionImport.message = message; } public static boolean isRecurse() { return recurse; } public static void setRecurse(boolean recurse) { SubversionImport.recurse = recurse; } private static void setupLibrary() { DAVRepositoryFactory.setup(); SVNRepositoryFactoryImpl.setup(); FSRepositoryFactory.setup(); } public static void main(String args[]){ setUrl(args[0]); setPath(args[1]); setMessage("Testing the Import"); setRecurse(true); execute(); } } Please excuse the poor programming, All I want is the importDirectory to work. Thanks James |
|
|
Re: VISTA SVN CONNECTION ISSUE svn: connection refused by the serverHello James,
It could be due to an incorrect url that you pass to your program. Can you execute the following command without any troubles: $ svn import localPath dstURL -m commitMessage where localPath, dstURL, commitMessage are those parameters you pass to the doImport() method. ---- Alexander Sinyushkin, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! James Dukah wrote: > I've been stuck on an svn exception when attempting to to import a directory > to a local url on the svn protocol and everytime I run the code I get A > Subversion error has been caused due to : > org.tmatesoft.svn.core.SVNException: svn: connection refused by the server > > public class SubversionImport { > > private static String path; > private static String url; > private static String message; > private static boolean recurse; > > private static CommitEventHandler commitHandler; > private static SVNClientManager clientManager; > > > public static void execute(){ > setupLibrary(); > try{ > SVNURL svnurl = SVNURL.parseURIDecoded(url); > ISVNOptions options = SVNWCUtil.createDefaultOptions(true); > clientManager = SVNClientManager.newInstance(options); > commitHandler = new CommitEventHandler(); > clientManager.getUpdateClient().setEventHandler(commitHandler); > File pathToImp = new File(path); > if(pathToImp.exists() && pathToImp.isDirectory()) > importDirectory(pathToImp, svnurl, message, recurse); > else > throw new IOException("Check that the directory to import exists"); > > }catch(IOException io){ > System.out.println(io.getMessage()); > }catch(SVNException svne){ > System.out.println("A Subversion error has been caused due to : " + > svne); > svne.printStackTrace(); > } > > } > > private static SVNCommitInfo importDirectory(File localPath,SVNURL > dstURL,String commitMessage, boolean isRecursive)throws SVNException { > return clientManager.getCommitClient( ).doImport( localPath , dstURL > , commitMessage , isRecursive ); > } > > public static String getPath() { > return path; > } > public static void setPath(String path) { > SubversionImport.path = path; > } > public static String getUrl() { > return url; > } > public static void setUrl(String url) { > SubversionImport.url = url; > } > public static String getMessage() { > return message; > } > public static void setMessage(String message) { > SubversionImport.message = message; > } > public static boolean isRecurse() { > return recurse; > } > public static void setRecurse(boolean recurse) { > SubversionImport.recurse = recurse; > } > > private static void setupLibrary() { > DAVRepositoryFactory.setup(); > SVNRepositoryFactoryImpl.setup(); > FSRepositoryFactory.setup(); > } > > public static void main(String args[]){ > setUrl(args[0]); > setPath(args[1]); > > setMessage("Testing the Import"); > setRecurse(true); > > execute(); > > } > > } > > Please excuse the poor programming, All I want is the importDirectory to > work. > > Thanks > > James --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
|
|
Re: VISTA SVN CONNECTION ISSUE svn: connection refused by the serverThank you for your response Alexander,
When I input "$ svn import localPath dstURL -m commitMessage" with the correct attributes, it runs fine. Unfortanetly it doesn't in my program. Here is my error output log; A Subversion error has been caused due to : org.tmatesoft.svn.core.SVNException: svn: connection refused by the server org.tmatesoft.svn.core.SVNException: svn: connection refused by the server at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:82) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:69) at org.tmatesoft.svn.core.internal.io.svn.SVNPlainConnector.open(SVNPlainConnector.java:62) at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:73) at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1234) at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVNRepositoryImpl.java:95) at org.tmatesoft.svn.core.io.SVNRepository.getRepositoryRoot(SVNRepository.java:319) at org.tmatesoft.svn.core.wc.SVNCommitClient.doImport(SVNCommitClient.java:640) at SubversionImport.importDirectory(SubversionImport.java:50) at SubversionImport.execute(SubversionImport.java:35) at SubversionImport.main(SubversionImport.java:91) Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createPlainSocket(SVNSocketFactory.java:53) at org.tmatesoft.svn.core.internal.io.svn.SVNPlainConnector.open(SVNPlainConnector.java:53) ... 8 more Could this be an issue with my connection settings? I am running Vista James
|
|
|
Re: VISTA SVN CONNECTION ISSUE svn: connection refused by the serverHello James,
Can you please send us the exact prompt command of how you start your svnserve, how you perform 'svn import' and the parameter values that go to clientManager.getCommitClient( ).doImport( localPath , dstURL, commitMessage , isRecursive ); ---- Alexander Sinyushkin, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! James Dukah wrote: > Thank you for your response Alexander, > > When I input "$ svn import localPath dstURL -m commitMessage" with the > correct attributes, it runs fine. Unfortanetly it doesn't in my program. > > Here is my error output log; > > A Subversion error has been caused due to : > org.tmatesoft.svn.core.SVNException: svn: connection refused by the server > org.tmatesoft.svn.core.SVNException: svn: connection refused by the server > at > org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:82) > at > org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:69) > at > org.tmatesoft.svn.core.internal.io.svn.SVNPlainConnector.open(SVNPlainConnector.java:62) > at > org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:73) > at > org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1234) > at > org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.testConnection(SVNRepositoryImpl.java:95) > at > org.tmatesoft.svn.core.io.SVNRepository.getRepositoryRoot(SVNRepository.java:319) > at > org.tmatesoft.svn.core.wc.SVNCommitClient.doImport(SVNCommitClient.java:640) > at SubversionImport.importDirectory(SubversionImport.java:50) > at SubversionImport.execute(SubversionImport.java:35) > at SubversionImport.main(SubversionImport.java:91) > Caused by: java.net.ConnectException: Connection refused: connect > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) > at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) > at java.net.Socket.connect(Socket.java:519) > at > org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createPlainSocket(SVNSocketFactory.java:53) > at > org.tmatesoft.svn.core.internal.io.svn.SVNPlainConnector.open(SVNPlainConnector.java:53) > ... 8 more > > > Could this be an issue with my connection settings? I am running Vista > > James > > > > Alexander Sinyushkin wrote: >> Hello James, >> >> It could be due to an incorrect url that you pass to your program. >> >> Can you execute the following command without any troubles: >> >> $ svn import localPath dstURL -m commitMessage >> >> where localPath, dstURL, commitMessage are those parameters you pass to >> the doImport() method. >> ---- >> Alexander Sinyushkin, >> TMate Software, >> http://svnkit.com/ - Java [Sub]Versioning Library! >> >> >> James Dukah wrote: >>> I've been stuck on an svn exception when attempting to to import a >>> directory >>> to a local url on the svn protocol and everytime I run the code I get A >>> Subversion error has been caused due to : >>> org.tmatesoft.svn.core.SVNException: svn: connection refused by the >>> server >>> >>> public class SubversionImport { >>> >>> private static String path; >>> private static String url; >>> private static String message; >>> private static boolean recurse; >>> >>> private static CommitEventHandler commitHandler; >>> private static SVNClientManager clientManager; >>> >>> >>> public static void execute(){ >>> setupLibrary(); >>> try{ >>> SVNURL svnurl = SVNURL.parseURIDecoded(url); >>> ISVNOptions options = SVNWCUtil.createDefaultOptions(true); >>> clientManager = SVNClientManager.newInstance(options); >>> commitHandler = new CommitEventHandler(); >>> clientManager.getUpdateClient().setEventHandler(commitHandler); >>> File pathToImp = new File(path); >>> if(pathToImp.exists() && pathToImp.isDirectory()) >>> importDirectory(pathToImp, svnurl, message, recurse); >>> else >>> throw new IOException("Check that the directory to import exists"); >>> >>> }catch(IOException io){ >>> System.out.println(io.getMessage()); >>> }catch(SVNException svne){ >>> System.out.println("A Subversion error has been caused due to : " + >>> svne); >>> svne.printStackTrace(); >>> } >>> >>> } >>> >>> private static SVNCommitInfo importDirectory(File localPath,SVNURL >>> dstURL,String commitMessage, boolean isRecursive)throws SVNException { >>> return clientManager.getCommitClient( ).doImport( localPath , >>> dstURL >>> , commitMessage , isRecursive ); >>> } >>> >>> public static String getPath() { >>> return path; >>> } >>> public static void setPath(String path) { >>> SubversionImport.path = path; >>> } >>> public static String getUrl() { >>> return url; >>> } >>> public static void setUrl(String url) { >>> SubversionImport.url = url; >>> } >>> public static String getMessage() { >>> return message; >>> } >>> public static void setMessage(String message) { >>> SubversionImport.message = message; >>> } >>> public static boolean isRecurse() { >>> return recurse; >>> } >>> public static void setRecurse(boolean recurse) { >>> SubversionImport.recurse = recurse; >>> } >>> >>> private static void setupLibrary() { >>> DAVRepositoryFactory.setup(); >>> SVNRepositoryFactoryImpl.setup(); >>> FSRepositoryFactory.setup(); >>> } >>> >>> public static void main(String args[]){ >>> setUrl(args[0]); >>> setPath(args[1]); >>> >>> setMessage("Testing the Import"); >>> setRecurse(true); >>> >>> execute(); >>> >>> } >>> >>> } >>> >>> Please excuse the poor programming, All I want is the importDirectory to >>> work. >>> >>> Thanks >>> >>> James >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: svnkit-users-unsubscribe@... >> For additional commands, e-mail: svnkit-users-help@... >> >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
|
|
Re: VISTA SVN CONNECTION ISSUE svn: connection refused by the serverHi Alexander,
I do not actually start svnserve when executing my program. I have svn started in my services on my windows machine. In my console window I perform the import by invoking; C:\Projects\Lama>svn import C:\Projects\Lama\Notes svn://localhost/Lama/Notes -m test I've learnt that if I use 127.0.0.1 instead of 'localhost' it doesn't give me the connection refused error anymore. I now receive this when I run the program; Exception in thread "main" java.lang.NullPointerException at org.tmatesoft.svn.core.wc.SVNCommitClient.importDir(SVNCommitClient.java:1481) at org.tmatesoft.svn.core.wc.SVNCommitClient.doImport(SVNCommitClient.java:693) at SubversionImport.importDirectory(SubversionImport.java:52) at SubversionImport.execute(SubversionImport.java:35) at SubversionImport.main(SubversionImport.java:94) I can run the svn import fine in command prompt so I know my Url and PATH I pass to the program is correct. What could be causing this? James
|
|
|
Re: VISTA SVN CONNECTION ISSUE svn: connection refused by the serverHello James,
What version of SVNKit are you using? ---- Alexander Sinyushkin, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! James Dukah wrote: > Hi Alexander, > > I do not actually start svnserve when executing my program. I have svn > started in my services on my windows machine. In my console window I perform > the import by invoking; > > C:\Projects\Lama>svn import C:\Projects\Lama\Notes > svn://localhost/Lama/Notes -m > test > > I've learnt that if I use 127.0.0.1 instead of 'localhost' it doesn't give > me the connection refused error anymore. > > I now receive this when I run the program; > > Exception in thread "main" java.lang.NullPointerException > at > org.tmatesoft.svn.core.wc.SVNCommitClient.importDir(SVNCommitClient.java:1481) > at > org.tmatesoft.svn.core.wc.SVNCommitClient.doImport(SVNCommitClient.java:693) > at SubversionImport.importDirectory(SubversionImport.java:52) > at SubversionImport.execute(SubversionImport.java:35) > at SubversionImport.main(SubversionImport.java:94) > > > I can run the svn import fine in command prompt so I know my Url and PATH I > pass to the program is correct. > What could be causing this? > > James > > > Hello James, > > Can you please send us the exact prompt command of how you start your > svnserve, > how you perform 'svn import' and the parameter values that go to > > clientManager.getCommitClient( ).doImport( localPath , > dstURL, commitMessage , isRecursive ); > > > > ---- > Alexander Sinyushkin, > TMate Software, > http://svnkit.com/ - Java [Sub]Versioning Library! > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
|
|
Re: VISTA SVN CONNECTION ISSUE svn: connection refused by the serverYour problem looks very similar to this one
http://www.nabble.com/SVN-protocol.-Connection-refused-by-the-server-tt22481558.html#a22481558 Maybe you'll also have to add "127.0.0.1 localhost" to your hosts file (for instance, read here http://jcreation.be/?p=31 on where this file can be found). What version of jdk do you use? ---- Alexander Sinyushkin, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! James Dukah wrote: > Hi Alexander, > > I do not actually start svnserve when executing my program. I have svn > started in my services on my windows machine. In my console window I perform > the import by invoking; > > C:\Projects\Lama>svn import C:\Projects\Lama\Notes > svn://localhost/Lama/Notes -m > test > > I've learnt that if I use 127.0.0.1 instead of 'localhost' it doesn't give > me the connection refused error anymore. > > I now receive this when I run the program; > > Exception in thread "main" java.lang.NullPointerException > at > org.tmatesoft.svn.core.wc.SVNCommitClient.importDir(SVNCommitClient.java:1481) > at > org.tmatesoft.svn.core.wc.SVNCommitClient.doImport(SVNCommitClient.java:693) > at SubversionImport.importDirectory(SubversionImport.java:52) > at SubversionImport.execute(SubversionImport.java:35) > at SubversionImport.main(SubversionImport.java:94) > > > I can run the svn import fine in command prompt so I know my Url and PATH I > pass to the program is correct. > What could be causing this? > > James > > > Hello James, > > Can you please send us the exact prompt command of how you start your > svnserve, > how you perform 'svn import' and the parameter values that go to > > clientManager.getCommitClient( ).doImport( localPath , > dstURL, commitMessage , isRecursive ); > > > > ---- > Alexander Sinyushkin, > TMate Software, > http://svnkit.com/ - Java [Sub]Versioning Library! > > > --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
|
|
Re: VISTA SVN CONNECTION ISSUE svn: connection refused by the serverHi Alexander,
As I initially thought, the problem was a Vista issue with the hosts. Thanks alot for the help. James
|
| Free embeddable forum powered by Nabble | Forum Help |