Tampilkan postingan dengan label SVN. Tampilkan semua postingan
Tampilkan postingan dengan label SVN. Tampilkan semua postingan

Minggu, 17 Juli 2011

Subclipse "SVN Cannot Create Tunnel" Error

When I check out SVN project in Eclipse via Subclipse plugin it fails and displays an error dialog "SVN: can't create tunnel". How do I fix it?
A few definitions first. Eclipse is a popular IDE for developing software, particularly Java, PHP, and C++. Subclipse is a plugin that can be installed on Eclipse making SVN tools available to the IDE's user. SVN is Subversion which is one of the most popular free source control software applications.

When I installed Subclipse on Eclipse on Windows 7 platform I didn't have trouble checking out and manipulating my SVN project which is hosted somewhere remotely. However when my friend did he saw the following error when trying to check out an SVN project:

Subclipse SVN Cannot Create Tunnel

If you are using SVN command line then the SVN command to check out a project looks like 'svn co svn+ssh://...'

How do I fix this error?

The Issue
When you check out an SVN project two protocols are needed: SSH, SVN. That's they the SVN project URL is prefixed with 'svn+ssh://'. This combination ensures that your communication with the SVN server is encrypted and secure. This means that Eclipse needs to know how the SSH protocol works. Below we'll discuss the solution.

Solution
Simply download any SSH client! Such tools include Putty and TortoiseSVN. Download Putty and reinstall Subclipse and see if the problem goes away. It should because when I installed Eclipse and Subclipse I already had Putty installed, and I never had this issue.

If your problem still exists for whatever reason, install TortoiseSVN and tell Subversion how to run SSH protocol by following these steps:

  • Install TortoiseSVN. Download the latest TortoiseSVN from their official website and install it.
  • Locate Subversion's configuration file. If you are using Windows 7 or Windows Vista it should be located at C:\Users\[User]\AppData\Roaming\Subversion\config. If you are using Windows XP it should be located at C:\Documents and Settings\%USERID%\Application Data\Subversion\config.
  • Edit Subversion's configuration file. Open it and locate the line where 'ssh' is commented out as follows "# ssh = $SVN_SSH ssh". This is where you need to let SVN know where the SSH executable file is. If you are using TortoiseSVN then change the line to 'ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe'. If you don't want to enter user name and password every time you use SVN then change the line to 'ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe -l user -pw password'
  • Check out your SVN project in Eclipse again

If you have any questions please let me know and I will do my best to help you!

Kamis, 03 Februari 2011

Create An SVN Project On An SVN Server

Q: I am using Eclipse on Windows and I'd like to check out SVN project with Eclipse. How the hell do I do it?

MenuCheck Out SVN In Eclipse On Windows
Create An SVN Project On An SVN Server
Download And Install TortoiseSVN
Check Out SVN Project Via TortoiseSVN
Validate SVN Integration With Eclipse

You use 'svnadmin' command to create an SVN repository where you will put in SVN projects. If you don't know how to do it google 'svnadmin create'. Let's assume your (intended) SVN server is running on Linux and you'd like the repository to be /home/michaelwen/svn. Subversion uses this directory to store information about your projects such as file revisions. You won't need to directly deal with this directory; so let's keep it in a safe place and not mess with its contents unless you know what you are doing. The command is the following:

svnadmin create /home/michaelwen/svn

Let's create a directory in your SVN repository to store a project named 'myproj':

svn mkdir file:///home/michaelwen/svn/myproj

Now go to the local folder where you keep the source code you'd like stored in the repository and add an SVN project via the 'svn import' command. An example is the following:

cd /home/michaelwen/where-my-code-for-myproj-is/myproj
svn import file:///home/michaelwen/svn/myproj -m "first import of myproj"


This command will put all contents in /home/michaelwen/where-my-code-for-myproj-is/myproj in file:///home/michaelwen/svn/myproj recursively.

◀ Check Out SVN In Eclipse On WindowsDownload And Install Tortoisesvn ▶

Validate Svn Integration With Eclipse

Q: I am using Eclipse on Windows and I'd like to check out SVN project with Eclipse. How the hell do I do it?

MenuCheck Out SVN In Eclipse On Windows
Create An SVN Project On An SVN Server
Download And Install TortoiseSVN
Check Out SVN Project Via TortoiseSVN
Validate SVN Integration With Eclipse
As I mentioned earlier you may not need TortoiseSVN at all if your Eclipse works fine with SVN. Read on to make sure this is the case. Even if this is not the case we've got a fall back solution for you.

To use SVN with Eclipse simply download and install Subclipse. Refer to any web tutorial on this topic if you haven't done so. Now when you use Subclipse to check out code from your SVN repository you may get the following error dialog:

Eclipse Subclipse SVN Operation Failure Dialog

If you do don't panic. This dialog is saying Subclipse fails to create ssh tunnel. A quick solution is simply change SVN interface from 'JavaHL (JNI)' to 'SVNKit (Pure Java) SVNKit' in Window -> Preferences -> Team -> SVN -> SVN Interface as follows:

Eclipse Subclipse SVN Interface Dialog

Once you made the change you should be able to use SVN operations smoothly within Eclipse! If you still don't for some reason, and I've heard cases like that, fall back on using TortoiseSVN to manage SVN checking out, updating, and committing changes to your code in Windows Explorer and use Eclipse to edit your code! It'll still be efficient once you get the hang of it.

◀ Check Out SVN Project Via TortoiseSVN

Check Out SVN Project Via TortoiseSVN

Q: I am using Eclipse on Windows and I'd like to check out SVN project with Eclipse. How the hell do I do it?

MenuCheck Out SVN In Eclipse On Windows
Create An SVN Project On An SVN Server
Download And Install TortoiseSVN
Check Out SVN Project Via TortoiseSVN
Validate SVN Integration With Eclipse
Once you have TortoiseSVN installed you can easily check out an SVN project into any local directory you want. Let's say you'd like to download some project into your D:. Right click on D: in any Windows Explorer window and pick 'SVN Checkout...' as follows:

TortoiseSVN SVN Checkout

xxx.xxx.xxx.xxx is the IP address where I hosted my project at. You should use your own SVN URL.

Click OK and you should see the checkout in progress like the following:

TortoiseSVN Svn Checkout In Progress

Once it says checkout done you are done! Now check your D: and the project should be checked out at D:\repository.

◀ Download And Install TortoiseSVNValidate SVN Integration With Eclipse ▶

Download And Install TortoiseSVN

Q: I am using Eclipse on Windows and I'd like to check out SVN project with Eclipse. How the hell do I do it?

MenuCheck Out SVN In Eclipse On Windows
Create An SVN Project On An SVN Server
Download And Install TortoiseSVN
Check Out SVN Project Via TortoiseSVN
Validate SVN Integration With Eclipse
TortoiseSVN is one of the most common Subversion clients you can find that runs on Windows OS. Once you install it you'll be able to see SVN operation options in the context menu (the menu that shows up when you right-click your mouse) and be able to perform any of those options. Technically you will NOT need TortoiseSVN once you get Eclipse integrated with Subversion on Windows but TortoiseSVN still provides great utility to you. If you don't feel like using it feel free to move on.

Instructions
Simply go to the download site of TortoiseSVN and download and install it. Note that you must download the version that matches your OS architecture (either 32-bit or 64-bit). If not you will NOT see the TortoiseSVN options in the context menu when you right-click some directory like it says you would:

TortoiseSVN Download 32 Bit Versus 64 Bit

After installing and rebooting you'll be able to see the following SVN operation options in the context-menu just like the following:

TortoiseSVN Context Menu

◀ Create An SVN Project On An SVN ServerCheck Out SVN Project Via TortoiseSVN ▶

Check Out Svn In Eclipse On Windows

Q: I am using Eclipse on Windows and I'd like to check out SVN project with Eclipse. How the hell do I do it?

MenuCheck Out SVN In Eclipse On Windows
Create An SVN Project On An SVN Server
Download And Install TortoiseSVN
Check Out SVN Project Via TortoiseSVN
Validate SVN Integration With Eclipse
Not sure where to start but I've had an amazingly difficult time to do this task. I am running Eclipse on Windows and I have my Subversion (SVN will be used in short from this point on) project running in some remote server. All I want to do is check out that SVN project and be able to integrate it with Eclipse so that I can do SVN operations within Eclipse instead of do them via command line. The problem is that the web server I am running on that remote server is Nginx, which does NOT have a standard way of integrating with SVN yet like Apache does. Therefore all I have is svn+ssh protocol to manage my SVN project, but the Subclipse plug-in for Eclipse seems to ONLY accept HTTP protocol as the SVN URL. Later I found out once I change the SVN interface it all works fine (described at Validate SVN Integration With Eclipse).

Can I blame it on Nginx? Can I blame it on Eclipse? Anyway finally I managed to solve this issue in the following steps. Preconditions are that I am running Windows 7.

1. Create an SVN project on your SVN server

2. Download and install TortoiseSVN: You may not need TortoiseSVN if your Eclipse is integrated with Subversion successfully but it's still a great tool to have.

3. Check out your SVN project through TortoiseSVN: Again you may not need TortoiseSVN if your Eclipse is integrated with Subversion successfully but in case it doesn't you have TortoiseSVN to fall back on.

4. Validate SVN Integration With Eclipse


Let's get started on how I managed to handle this monstrous issue!

Create An Svn Project On An SVN Server ▶
 
support by: infomediaku.com