3

I have several Force.com projects in the same workspace, which I am doing development on using Eclipse Kepler and the Force.com IDE. Additionally, I am using EGit to version control all the projects.

Within the last two days, I have noticed that on startup of Eclipse, while the 'building workspace' operation is in progress, Eclipse is also deploying project contents of one of the projects to the server. This results in all the Apex classes in that salesforce instance being overwritten by what's in my local project. The other projects are not behaving this way.

Any ideas as to why this is happening would be very helpful. Thank you.

Edit: From the .log file for my workspace, I found this entry:

!ENTRY org.eclipse.core.resources 2 10035 2014-09-25 17:31:21.097 !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

Could this be related?

3

Upon further research, I believe this occurs when Eclipse does not shut down properly, due to either a crash or a force close. While eclipse is running, it creates snapshots of the workspace changes incrementally, on a regular shutdown, the workspace is saved and the snap files are deleted. When a crash occurs and the workspace isn’t saved properly, on startup eclipse uses the snap file to try to rebuild the workspace. I think this is Eclipse essentially re-applying the last operation of updating all the files. Except this time it’s done by Eclipse and not be a refresh from server through the force.com plugin, so the files are updated, saved, and that save is propagated to the server.

Resolution: try not to force close eclipse if at all possible. If an improper shutdown does occur, go to yourworkspace.metadata.plugins\org.eclipse.core.resources and delete the .snap file. This will prevent eclipse from trying to reload the changes from the last time it was open, but your workspace will be in the state it was before the snap was taken. So all the projects will need to be refreshed from server.

0

Just a theory, but I bet this would stop happening if you turn off the "Build Automatically" setting on your projects. I run with this setting off in general because it causes a lot of slowdown (and occasionally other odd behaviors) whenever a file gets saved, which is especially irritating when making local changes during your git check-in process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.