Why can't I import all files from TFS into my Eclipse project?
-
Tuesday, February 01, 2011 12:15 AM
Hi All,
I'm running Eclipse 3.5 Galileo with the Team Explorer Everywhere 2010 plugin. My team has a TFS server setup and we have a project there. When I try to import a project I get the message below:
"The selected project "src" is not mapped directly beneath your eclipse workspace."
Has anyone run into this problem?
Thanks,
Anthony
All Replies
-
Wednesday, February 02, 2011 9:21 AMOwner
Hi Anthony - sounds like you have the files downloaded locally is that correct?
Probably the easiest way to get the files into your Eclipse workspace if they have already been downloaded is to do the following:
- Go to Window, Show View, Other...
- Select Team Foundation Server, Team Explorer
- This will give you the Team Explorer View. Click on the little icon with a "+" on it to connect to TFS
- Connect to your team project collection
- Once connected, open the team project and double click on the source control node in team explorer to open the Source Control editor.
- Browse to the folder that contains your Eclipse project. Note that this is the folder that contains the .project file from Eclipse (typically the level above the src folder)
- Right click on the folder and select "Import..." This will then generally do the right thing for you.
If you find that you are still not able to proceeed then this is probably because you are trying to import something into your Eclipse workspace that you have already downloaded into a child folder in your Eclipse workspace direction which is not allowed by Eclipse. In this case you can try getting the project into your Eclipse workspace using the Import, Existing Project Into Workspace... option and once you have the Eclipse part sorted then you can do Team, Share Project..., Team Foundation Server to let Eclipse know that you want it managed by the TFS plug-in
If all else fails and you get really stuck then another way is to simply start with a fresh Eclipse workspace and new TFS workspace then simply do a Import, Team, Team Foundation Server to get the files into your new Eclipse workspace folder.
Hope that helps - let me know how you get on.
Martin.
http://www.woodwardweb.com- Proposed As Answer by Martin WoodwardMicrosoft Employee, Owner Wednesday, February 02, 2011 9:23 AM
- Marked As Answer by Martin WoodwardMicrosoft Employee, Owner Wednesday, February 09, 2011 10:57 AM
-
Friday, April 01, 2011 11:36 AM
Hello everyone,
I do have similar problem. When I try to import a project from TFS to eclipse I get an error "Error querying workspaces: null"
I am able to connect through TFS and able to see the team projects. But when I try to add project or import project from team foundation server, i have this problem. I am using eclipse Galelio
when i type tf workspaces in the console, i get
tf workspaces
[Fatal Error] :-1:-1: Premature end of file.
Exception in thread "main" java.lang.NullPointerException
at com.microsoft.tfs.client.clc.vc.commands.CommandWorkspaces.displayAndUpdate(CommandWorkspaces.java:365)
at com.microsoft.tfs.client.clc.vc.commands.CommandWorkspaces.run(CommandWorkspaces.java:103)
at com.microsoft.tfs.client.clc.Application.run(Application.java:325)
at com.microsoft.tfs.client.clc.Application.run(Application.java:146)
at com.microsoft.tfs.client.clc.vc.Main.main(Main.java:34)please let me know if you have some idea about the problem..
thanks
Sreejith
-
Friday, April 08, 2011 12:27 PMOwner
This error appears to related to reading your local workspace cache. Perhaps it became corrupt because a process that was writing it was terminated.
You can try deleting your workspace file cache (which will be rebuilt when you run "tf workspaces -collection:...") to see if this error goes away. See the TEE documentation for instructions on finding the file ("workspaces.xml").
- Proposed As Answer by Shaw TerwilligerOwner Friday, April 08, 2011 12:27 PM
- Unproposed As Answer by Shaw TerwilligerOwner Friday, April 08, 2011 12:27 PM
-
Sunday, October 30, 2011 11:22 PM
In case anyone else experiences this. I too got "Error querying workspaces: null". Shaw's answer gave me the hint I needed.
I run Eclipse on Ubuntu with TFS. I searched for and found the workspaces.xml file in "~/.microsoft/Team Explorer/10.0/workspaces". I deleted the file and associated lock file.
Another thing I did prior to this (which didn't help at the time), was to use Visual Studio on my Win2003 machine to delete the workspace for the ubuntu box (Source Code Explorer -> Workspaces dropdown box).
No need to run any utility (there is none). Just fired up Eclipse and Team Explorer and reconnected. Everything worked.
cheers- Edited by Cartland Sunday, October 30, 2011 11:24 PM

