Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368609 - save file and save all generate java.lang.NullPointerException
Summary: save file and save all generate java.lang.NullPointerException
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-cvs-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-14 15:41 EST by Roy Lowrance CLA
Modified: 2012-01-16 10:24 EST (History)
3 users (show)

See Also:


Attachments
/<workspace>/.metadata/.log (473.58 KB, text/plain)
2012-01-15 11:09 EST, Roy Lowrance CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Lowrance CLA 2012-01-14 15:41:13 EST
Build Identifier:  I20110613-1736

I am editing a java program and invoke save file or save all. The file seems to be saved, but a dialog box is generated: "Save Failed. java.lang.NullPointerException". The details are the same as the message.

This just started. I tried relaunching Eclipse and got the same problem.

I tried shutting down my linux system and restarting and got the same problem.

Reproducible: Always

Steps to Reproduce:
1. Shut down Eclipse Indigo.
2. Restart.
3. Navigate to the file.
4. End File > Save and see the "Save Failed. java.lang.NullPointerException" dialog.
Comment 1 Remy Suen CLA 2012-01-15 07:51:15 EST
Please attach your workspace's log file to this bug.
Comment 2 Roy Lowrance CLA 2012-01-15 11:09:11 EST
Created attachment 209505 [details]
/<workspace>/.metadata/.log
Comment 3 Paul Webster CLA 2012-01-16 07:29:15 EST
Where exactly is your workspace located?  It looks like something outside of eclipse has wiped a bunch of files.

PW
Comment 4 Roy Lowrance CLA 2012-01-16 07:42:12 EST
My workspace is in a Dropbox folder: /home/roy/Dropbox/eclipse-workspace/
Comment 5 Paul Webster CLA 2012-01-16 08:09:18 EST
What is adding and deleting files on the filesystem?  i.e. where are all those errors about missing projects and locations coming from?

It looks like something outside of eclipse has made files disappear, and even cut things out of the <workspace>/.metadata directory.  That's probably the root cause for the save error.

PW
Comment 6 Roy Lowrance CLA 2012-01-16 08:59:32 EST
I'm guessing that the deletions are caused by the Dropbox synchronization, as I work on the same eclipse workspace on multiple platforms.

If that's the root cause, we should close this bug.
Comment 7 Paul Webster CLA 2012-01-16 10:24:47 EST
I believe so.  Eclipse workspaces cannot be shared very easily.  It's main usecase is the workspace is local, and the projects come from an SCM (CVS, git, etc).

In the .metadata folder, it stores information based on absolute paths from the local disks, for example.

Some possible workarounds that might help you:

1) activate Preferences>General>Workspace>refresh automatically so that eclipse will try and keep the workspace up to date with the file system.  This won't effect the bad behaviour in .metadata

2) keep your workspaces themselves local, but create/import the projects from the common dropbox area and activate the pref in #1.  That keeps the projects themselves in sync without corrupting the .metadata folder.

3) have the workspace *and* project local, but have a linked source folder into the dropbox area.  That would allow you to keep even the eclipse project settings outside of your source tree ... but you would have to keep re-configuring them.

I would probably try Option 2 in your situation.

PW