Re-pursuing problem with Eclipse on Ubuntu VM "losing" all imported projects [message #1729877] |
Tue, 19 April 2016 17:23  |
Eclipse User |
|
|
|
For quite a while now, I've been hampered with a very annoying problem in my development environment.
My laptop is CentOS7.2. I primarily work on an Eclipse plugin codebase. I have the code checked out in a git repo, and my Eclipse workspace references the projects defined there. In order to step through the code safely without locking up the machine (the app sometimes renders menus), I run an Ubuntu VM that also runs Eclipse, and I just import all of the projects (not copy) residing in the git repo on the main box. I use a "shared folder" so I can access the host's files from the VM.
From that Eclipse instance on the VM, I run an "Eclipse Application" launch config, with the "debug" VM parameters. I connect to that instance from the Eclpse instance on the main CentOS box.
This generally works fine.
However, I've found that it's risky to bring down the Eclipse instance on the VM (not the "test instance", but the one that I imported the projects into), because quite often when I restart that Eclipse instance, the window comes up and shows zero projects. If when I last had it open I was viewing files from those projects, the editor views just show errors, saying the files don't exist anymore. Many times I've checked at that moment to see if the path to the shared folder is invalid, but it never is. I can clearly see all the project files in that path.
At this point, what I do is simply switch to a new workspace, reimport all of the projects, set my target platform, recreate the run configuration, and do other little cleanup steps that I have to do every time I recreate the workspace, which I've done numerous times now.
Also note that this first started happening with my Ubuntu 14.04 VM, running VirtualBox 4. I am now seeing the same symptom with a different Ubuntu 15.10 VM, and VirtualBox 5. I generally use Mars.2, but I tried the latest Neon release at one point, and saw the same problem.
I would guess that I could avoid this problem if I chose the "copy into workspace" option, but I'd rather this just worked. If I copy the projects, I'll have to figure out a "sync" process to keep the imported projects up to date. I'm not sure of the best way to do that.
Also note that besides this problem with Eclipse, these VMs work perfectly fine. I use them to reach the internet, I run other remote VMs from them, all fine.
|
|
|
|
|
|
Re: Re-pursuing problem with Eclipse on Ubuntu VM "losing" all imported projects [message #1729986 is a reply to message #1729980] |
Wed, 20 April 2016 12:29   |
Eclipse User |
|
|
|
Ok, I understand VM snapshots now.
One thing that is not clear is "when" this corruption is happening. You'd think it would be happening at startup time, but it could be happening at shutdown time. If it's the latter, then if the snapshot is taken before I start Eclipse, and I run a remote debugger on Eclipse startup, all I'll see is that Eclipse doesn't find any projects.
The main problem that I have, however, is that even if the corruption does happen at startup, and I step through startup in the debugger, I have no idea what I should be looking for. I've tried doing recursive diffs of saved workspaces that appeared to be corrupted with new workspaces that appeared to not be corrupted. I found differences, but I have no idea what differences are relevant.
I could use some guidance on what I should be setting breakpoints in, and what data structures I should be examining. I'll also need to figure out how to get the real source for some of what I'll be stepping through.
|
|
|
Re: Re-pursuing problem with Eclipse on Ubuntu VM "losing" all imported projects [message #1729990 is a reply to message #1729986] |
Wed, 20 April 2016 12:53  |
Eclipse User |
|
|
|
I'm not an expert on Core Resources, so I'd start at ResourcesPlugin.start(), which is called when the bundle is activated. This method begins the process of opening the workspace and verifying and possibly rebuilding the metadata. It quickly calls into Workspace.open() that does most of the lifting.
You'll also want to enable most of the tracing options for org.eclipse.core.resources (see the Tracing tab of the debug launcher) including the /restore*, /save*, and /refresh options.
You should document your findings on your bug report rather than opening up new messages here on the forum.
Brian.
|
|
|
Powered by
FUDForum. Page generated in 0.03007 seconds