|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Proxy problem, is this a bug?I've run into the strangest problem. If I set up a proxy server, and
adjust the 'servers' file in $user.home/.subversion to use the proxy server by setting both http-proxy-server and http-proxy-port, most things work well. The problem is that if I pass a BasicAuthenticationManager to SVNClientManager.newInstance, the proxy is not used. If I don't use the authentication manager, the proxy is used. Below is the code I'm testing with. This is using a public, open-source project at sourceforge, so it's pretty easy to test. Actually, you don't even need a proxy server. Just set http-proxy-server and -port in $user.home/.subversion/servers to a location where there is NOT a proxy server, and note that the checkout succeeds if the BasicAuthenticationManager is used, and that it fails with "org.tmatesoft.svn.core.SVNException: svn: connection refused by the server" in the case where the authentication manager is not used. I should mention also that I do not have any proxy settings in my Java Control Panel. The only proxy settings I have are in the .subversion/servers file. So is this a bug, or am I doing something wrong? Thanks, Dale package ise.plugin.svn.command; import org.tmatesoft.svn.core.SVNDepth; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.wc.ISVNOptions; import org.tmatesoft.svn.core.wc.SVNClientManager; import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc.SVNUpdateClient; import org.tmatesoft.svn.core.wc.SVNWCUtil; import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; import java.io.File; public class SVNCheckoutTest { public static void main ( String[] args ) { try { setup(); ISVNOptions options = SVNWCUtil.createDefaultOptions( true ); //SVNClientManager clientManager = SVNClientManager.newInstance( options, new BasicAuthenticationManager( "username", "password" ) ); SVNClientManager clientManager = SVNClientManager.newInstance( options ); SVNUpdateClient client = clientManager.getUpdateClient(); client.setEventHandler( new SVNCommandEventProcessor( System.out, System.err, false ) ); File localPath = new File( System.getProperty( "java.io.tmpdir" ), "/BufferLocal-1.3.0" ); localPath.deleteOnExit(); long revision = client.doCheckout( SVNURL.parseURIDecoded( "https://jedit.svn.sourceforge.net/svnroot/jedit/plugins/BufferLocal/tags/1.3.0" ), localPath, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, false ); } catch ( Exception e ) { e.printStackTrace(); } } public static void setup() { org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory.setup(); org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl.setup(); org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory.setup(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
|
|
Re: Proxy problem, is this a bug?Hello Dale,
This is not a bug - as long as you use BasicAuthenticationManager, standard configuration files are not used, so SVNKit doesn't know about your proxy settings. You may need to set proxy with BasicAuthenticationManager using its setProxy(...) method. Alexander Kitaev, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! http://sqljet.com/ - Java SQLite Library! Dale Anson wrote: > I've run into the strangest problem. If I set up a proxy server, and > adjust the 'servers' file in $user.home/.subversion to use the proxy > server by setting both http-proxy-server and http-proxy-port, most > things work well. The problem is that if I pass a > BasicAuthenticationManager to SVNClientManager.newInstance, the proxy > is not used. If I don't use the authentication manager, the proxy is > used. > > Below is the code I'm testing with. This is using a public, > open-source project at sourceforge, so it's pretty easy to test. > Actually, you don't even need a proxy server. Just set > http-proxy-server and -port in $user.home/.subversion/servers to a > location where there is NOT a proxy server, and note that the checkout > succeeds if the BasicAuthenticationManager is used, and that it fails > with "org.tmatesoft.svn.core.SVNException: svn: connection refused by > the server" in the case where the authentication manager is not used. > > I should mention also that I do not have any proxy settings in my Java > Control Panel. The only proxy settings I have are in the > .subversion/servers file. > > So is this a bug, or am I doing something wrong? > > Thanks, > > Dale > > > > package ise.plugin.svn.command; > > import org.tmatesoft.svn.core.SVNDepth; > import org.tmatesoft.svn.core.SVNURL; > import org.tmatesoft.svn.core.wc.ISVNOptions; > import org.tmatesoft.svn.core.wc.SVNClientManager; > import org.tmatesoft.svn.core.wc.SVNRevision; > import org.tmatesoft.svn.core.wc.SVNUpdateClient; > import org.tmatesoft.svn.core.wc.SVNWCUtil; > import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; > import java.io.File; > > public class SVNCheckoutTest { > public static void main ( String[] args ) { > try { > setup(); > ISVNOptions options = SVNWCUtil.createDefaultOptions( true ); > //SVNClientManager clientManager = > SVNClientManager.newInstance( options, new BasicAuthenticationManager( > "username", "password" ) ); > SVNClientManager clientManager = > SVNClientManager.newInstance( options ); > SVNUpdateClient client = clientManager.getUpdateClient(); > client.setEventHandler( new SVNCommandEventProcessor( > System.out, System.err, false ) ); > File localPath = new File( System.getProperty( > "java.io.tmpdir" ), "/BufferLocal-1.3.0" ); > localPath.deleteOnExit(); > long revision = client.doCheckout( SVNURL.parseURIDecoded( > "https://jedit.svn.sourceforge.net/svnroot/jedit/plugins/BufferLocal/tags/1.3.0" > ), localPath, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, > false ); > } > catch ( Exception e ) { > e.printStackTrace(); > } > } > > public static void setup() { > org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory.setup(); > org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl.setup(); > org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory.setup(); > } > } > > --------------------------------------------------------------------- > 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: Proxy problem, is this a bug?Thanks for the help. I didn't realize that BasicAuthenticationManager
did anything more than wrap username and password. I see now that there is a more useful (at least in this case) authentication manager: org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager This class is not listed in the javadoc API pages. In general, is it okay to use classes in the "internal" package? Thanks, Dale On Wed, Oct 14, 2009 at 6:24 AM, Alexander Kitaev <Alexander.Kitaev@...> wrote: > Hello Dale, > > This is not a bug - as long as you use BasicAuthenticationManager, > standard configuration files are not used, so SVNKit doesn't know about > your proxy settings. > > You may need to set proxy with BasicAuthenticationManager using its > setProxy(...) method. > > Alexander Kitaev, > TMate Software, > http://svnkit.com/ - Java [Sub]Versioning Library! > http://sqljet.com/ - Java SQLite Library! > > Dale Anson wrote: >> I've run into the strangest problem. If I set up a proxy server, and >> adjust the 'servers' file in $user.home/.subversion to use the proxy >> server by setting both http-proxy-server and http-proxy-port, most >> things work well. The problem is that if I pass a >> BasicAuthenticationManager to SVNClientManager.newInstance, the proxy >> is not used. If I don't use the authentication manager, the proxy is >> used. >> >> Below is the code I'm testing with. This is using a public, >> open-source project at sourceforge, so it's pretty easy to test. >> Actually, you don't even need a proxy server. Just set >> http-proxy-server and -port in $user.home/.subversion/servers to a >> location where there is NOT a proxy server, and note that the checkout >> succeeds if the BasicAuthenticationManager is used, and that it fails >> with "org.tmatesoft.svn.core.SVNException: svn: connection refused by >> the server" in the case where the authentication manager is not used. >> >> I should mention also that I do not have any proxy settings in my Java >> Control Panel. The only proxy settings I have are in the >> .subversion/servers file. >> >> So is this a bug, or am I doing something wrong? >> >> Thanks, >> >> Dale >> >> >> >> package ise.plugin.svn.command; >> >> import org.tmatesoft.svn.core.SVNDepth; >> import org.tmatesoft.svn.core.SVNURL; >> import org.tmatesoft.svn.core.wc.ISVNOptions; >> import org.tmatesoft.svn.core.wc.SVNClientManager; >> import org.tmatesoft.svn.core.wc.SVNRevision; >> import org.tmatesoft.svn.core.wc.SVNUpdateClient; >> import org.tmatesoft.svn.core.wc.SVNWCUtil; >> import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; >> import java.io.File; >> >> public class SVNCheckoutTest { >> public static void main ( String[] args ) { >> try { >> setup(); >> ISVNOptions options = SVNWCUtil.createDefaultOptions( true ); >> //SVNClientManager clientManager = >> SVNClientManager.newInstance( options, new BasicAuthenticationManager( >> "username", "password" ) ); >> SVNClientManager clientManager = >> SVNClientManager.newInstance( options ); >> SVNUpdateClient client = clientManager.getUpdateClient(); >> client.setEventHandler( new SVNCommandEventProcessor( >> System.out, System.err, false ) ); >> File localPath = new File( System.getProperty( >> "java.io.tmpdir" ), "/BufferLocal-1.3.0" ); >> localPath.deleteOnExit(); >> long revision = client.doCheckout( SVNURL.parseURIDecoded( >> "https://jedit.svn.sourceforge.net/svnroot/jedit/plugins/BufferLocal/tags/1.3.0" >> ), localPath, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, >> false ); >> } >> catch ( Exception e ) { >> e.printStackTrace(); >> } >> } >> >> public static void setup() { >> org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory.setup(); >> org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl.setup(); >> org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory.setup(); >> } >> } >> >> --------------------------------------------------------------------- >> 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@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
|
|
Re: Proxy problem, is this a bug?Hello Dale,
> org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager > > This class is not listed in the javadoc API pages. In general, is it > okay to use classes in the "internal" package? I'd recommend you to call SVNWCUtil.createDefaultAuthenticationManager() method - it will create instance of that class for you. Alexander Kitaev, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! http://sqljet.com/ - Java SQLite Library! Dale Anson wrote: > Thanks for the help. I didn't realize that BasicAuthenticationManager > did anything more than wrap username and password. > > I see now that there is a more useful (at least in this case) > authentication manager: > > org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager > > This class is not listed in the javadoc API pages. In general, is it > okay to use classes in the "internal" package? > > Thanks, > > Dale > > > On Wed, Oct 14, 2009 at 6:24 AM, Alexander Kitaev > <Alexander.Kitaev@...> wrote: >> Hello Dale, >> >> This is not a bug - as long as you use BasicAuthenticationManager, >> standard configuration files are not used, so SVNKit doesn't know about >> your proxy settings. >> >> You may need to set proxy with BasicAuthenticationManager using its >> setProxy(...) method. >> >> Alexander Kitaev, >> TMate Software, >> http://svnkit.com/ - Java [Sub]Versioning Library! >> http://sqljet.com/ - Java SQLite Library! >> >> Dale Anson wrote: >>> I've run into the strangest problem. If I set up a proxy server, and >>> adjust the 'servers' file in $user.home/.subversion to use the proxy >>> server by setting both http-proxy-server and http-proxy-port, most >>> things work well. The problem is that if I pass a >>> BasicAuthenticationManager to SVNClientManager.newInstance, the proxy >>> is not used. If I don't use the authentication manager, the proxy is >>> used. >>> >>> Below is the code I'm testing with. This is using a public, >>> open-source project at sourceforge, so it's pretty easy to test. >>> Actually, you don't even need a proxy server. Just set >>> http-proxy-server and -port in $user.home/.subversion/servers to a >>> location where there is NOT a proxy server, and note that the checkout >>> succeeds if the BasicAuthenticationManager is used, and that it fails >>> with "org.tmatesoft.svn.core.SVNException: svn: connection refused by >>> the server" in the case where the authentication manager is not used. >>> >>> I should mention also that I do not have any proxy settings in my Java >>> Control Panel. The only proxy settings I have are in the >>> .subversion/servers file. >>> >>> So is this a bug, or am I doing something wrong? >>> >>> Thanks, >>> >>> Dale >>> >>> >>> >>> package ise.plugin.svn.command; >>> >>> import org.tmatesoft.svn.core.SVNDepth; >>> import org.tmatesoft.svn.core.SVNURL; >>> import org.tmatesoft.svn.core.wc.ISVNOptions; >>> import org.tmatesoft.svn.core.wc.SVNClientManager; >>> import org.tmatesoft.svn.core.wc.SVNRevision; >>> import org.tmatesoft.svn.core.wc.SVNUpdateClient; >>> import org.tmatesoft.svn.core.wc.SVNWCUtil; >>> import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; >>> import java.io.File; >>> >>> public class SVNCheckoutTest { >>> public static void main ( String[] args ) { >>> try { >>> setup(); >>> ISVNOptions options = SVNWCUtil.createDefaultOptions( true ); >>> //SVNClientManager clientManager = >>> SVNClientManager.newInstance( options, new BasicAuthenticationManager( >>> "username", "password" ) ); >>> SVNClientManager clientManager = >>> SVNClientManager.newInstance( options ); >>> SVNUpdateClient client = clientManager.getUpdateClient(); >>> client.setEventHandler( new SVNCommandEventProcessor( >>> System.out, System.err, false ) ); >>> File localPath = new File( System.getProperty( >>> "java.io.tmpdir" ), "/BufferLocal-1.3.0" ); >>> localPath.deleteOnExit(); >>> long revision = client.doCheckout( SVNURL.parseURIDecoded( >>> "https://jedit.svn.sourceforge.net/svnroot/jedit/plugins/BufferLocal/tags/1.3.0" >>> ), localPath, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, >>> false ); >>> } >>> catch ( Exception e ) { >>> e.printStackTrace(); >>> } >>> } >>> >>> public static void setup() { >>> org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory.setup(); >>> org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl.setup(); >>> org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory.setup(); >>> } >>> } >>> >>> --------------------------------------------------------------------- >>> 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@... >> >> > > --------------------------------------------------------------------- > 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: Proxy problem, is this a bug?Perfect, thanks!
On Wed, Oct 14, 2009 at 7:40 AM, Alexander Kitaev <kitaev@...> wrote: > Hello Dale, > >> org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager >> >> This class is not listed in the javadoc API pages. In general, is it >> okay to use classes in the "internal" package? > I'd recommend you to call SVNWCUtil.createDefaultAuthenticationManager() > method - it will create instance of that class for you. > > Alexander Kitaev, > TMate Software, > http://svnkit.com/ - Java [Sub]Versioning Library! > http://sqljet.com/ - Java SQLite Library! > > Dale Anson wrote: >> Thanks for the help. I didn't realize that BasicAuthenticationManager >> did anything more than wrap username and password. >> >> I see now that there is a more useful (at least in this case) >> authentication manager: >> >> org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager >> >> This class is not listed in the javadoc API pages. In general, is it >> okay to use classes in the "internal" package? >> >> Thanks, >> >> Dale >> >> >> On Wed, Oct 14, 2009 at 6:24 AM, Alexander Kitaev >> <Alexander.Kitaev@...> wrote: >>> Hello Dale, >>> >>> This is not a bug - as long as you use BasicAuthenticationManager, >>> standard configuration files are not used, so SVNKit doesn't know about >>> your proxy settings. >>> >>> You may need to set proxy with BasicAuthenticationManager using its >>> setProxy(...) method. >>> >>> Alexander Kitaev, >>> TMate Software, >>> http://svnkit.com/ - Java [Sub]Versioning Library! >>> http://sqljet.com/ - Java SQLite Library! >>> >>> Dale Anson wrote: >>>> I've run into the strangest problem. If I set up a proxy server, and >>>> adjust the 'servers' file in $user.home/.subversion to use the proxy >>>> server by setting both http-proxy-server and http-proxy-port, most >>>> things work well. The problem is that if I pass a >>>> BasicAuthenticationManager to SVNClientManager.newInstance, the proxy >>>> is not used. If I don't use the authentication manager, the proxy is >>>> used. >>>> >>>> Below is the code I'm testing with. This is using a public, >>>> open-source project at sourceforge, so it's pretty easy to test. >>>> Actually, you don't even need a proxy server. Just set >>>> http-proxy-server and -port in $user.home/.subversion/servers to a >>>> location where there is NOT a proxy server, and note that the checkout >>>> succeeds if the BasicAuthenticationManager is used, and that it fails >>>> with "org.tmatesoft.svn.core.SVNException: svn: connection refused by >>>> the server" in the case where the authentication manager is not used. >>>> >>>> I should mention also that I do not have any proxy settings in my Java >>>> Control Panel. The only proxy settings I have are in the >>>> .subversion/servers file. >>>> >>>> So is this a bug, or am I doing something wrong? >>>> >>>> Thanks, >>>> >>>> Dale >>>> >>>> >>>> >>>> package ise.plugin.svn.command; >>>> >>>> import org.tmatesoft.svn.core.SVNDepth; >>>> import org.tmatesoft.svn.core.SVNURL; >>>> import org.tmatesoft.svn.core.wc.ISVNOptions; >>>> import org.tmatesoft.svn.core.wc.SVNClientManager; >>>> import org.tmatesoft.svn.core.wc.SVNRevision; >>>> import org.tmatesoft.svn.core.wc.SVNUpdateClient; >>>> import org.tmatesoft.svn.core.wc.SVNWCUtil; >>>> import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; >>>> import java.io.File; >>>> >>>> public class SVNCheckoutTest { >>>> public static void main ( String[] args ) { >>>> try { >>>> setup(); >>>> ISVNOptions options = SVNWCUtil.createDefaultOptions( true ); >>>> //SVNClientManager clientManager = >>>> SVNClientManager.newInstance( options, new BasicAuthenticationManager( >>>> "username", "password" ) ); >>>> SVNClientManager clientManager = >>>> SVNClientManager.newInstance( options ); >>>> SVNUpdateClient client = clientManager.getUpdateClient(); >>>> client.setEventHandler( new SVNCommandEventProcessor( >>>> System.out, System.err, false ) ); >>>> File localPath = new File( System.getProperty( >>>> "java.io.tmpdir" ), "/BufferLocal-1.3.0" ); >>>> localPath.deleteOnExit(); >>>> long revision = client.doCheckout( SVNURL.parseURIDecoded( >>>> "https://jedit.svn.sourceforge.net/svnroot/jedit/plugins/BufferLocal/tags/1.3.0" >>>> ), localPath, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, >>>> false ); >>>> } >>>> catch ( Exception e ) { >>>> e.printStackTrace(); >>>> } >>>> } >>>> >>>> public static void setup() { >>>> org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory.setup(); >>>> org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl.setup(); >>>> org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory.setup(); >>>> } >>>> } >>>> >>>> --------------------------------------------------------------------- >>>> 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@... >>> >>> >> >> --------------------------------------------------------------------- >> 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@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
| Free embeddable forum powered by Nabble | Forum Help |